{"id":26519699,"url":"https://github.com/fbertola/bgfx-python","last_synced_at":"2025-04-10T02:20:50.569Z","repository":{"id":40568701,"uuid":"187920904","full_name":"fbertola/bgfx-python","owner":"fbertola","description":"Python 3.7+ wrapper for the BGFX library. 🐍","archived":false,"fork":false,"pushed_at":"2022-12-09T05:58:53.000Z","size":2308,"stargazers_count":126,"open_issues_count":12,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T01:11:15.276Z","etag":null,"topics":["bgfx","cpp","cppyy","directx","imgui","metal","opengl","python","vulkan"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fbertola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-21T22:13:38.000Z","updated_at":"2025-03-29T15:20:43.000Z","dependencies_parsed_at":"2023-01-25T17:00:41.494Z","dependency_job_id":null,"html_url":"https://github.com/fbertola/bgfx-python","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbertola%2Fbgfx-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbertola%2Fbgfx-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbertola%2Fbgfx-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbertola%2Fbgfx-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbertola","download_url":"https://codeload.github.com/fbertola/bgfx-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143078,"owners_count":21054702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bgfx","cpp","cppyy","directx","imgui","metal","opengl","python","vulkan"],"created_at":"2025-03-21T11:23:23.252Z","updated_at":"2025-04-10T02:20:50.549Z","avatar_url":"https://github.com/fbertola.png","language":"CMake","readme":"\u003ch1 align=\"center\"\u003e \n  \u003cbr\u003e\n  BGFX Python\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003ePython 3.7+ wrapper for the BGFX library.\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/pyversions/bgfx-python\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/v/bgfx-python\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/wheel/bgfx-python\"\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://github.com/fbertola/bgfx-python/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/fbertola/bgfx-python.svg\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/contributions-welcome-orange.svg\"\u003e\n  \u003ca href=\"https://opensource.org/licenses/BSD\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-BSD--2%20clause-blue.svg\"\u003e\u003c/a\u003e\n  \u003cbr /\u003e\n  \u003cimg src=\"https://github.com/fbertola/bgfx-python/workflows/build/badge.svg\"\u003e\n  \u003cimg src=\"https://github.com/fbertola/bgfx-python/workflows/tests/badge.svg\"\u003e\n  \u003ca href=\"https://ci.appveyor.com/project/fbertola/bgfx-python/branch/master\"\u003e\u003cimg src=\"https://ci.appveyor.com/api/projects/status/bu72q2ybqb6eqhbq/branch/master?svg=true\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#key-features\"\u003eKey Features\u003c/a\u003e •\n  \u003ca href=\"#how-to-use\"\u003eHow To Use\u003c/a\u003e • •\n  \u003ca href=\"#using-imgui\"\u003eUsing ImGUI\u003c/a\u003e •\n  \u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e •\n  \u003ca href=\"#logging\"\u003eLogging\u003c/a\u003e •\n  \u003ca href=\"#credits\"\u003eCredits\u003c/a\u003e •\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/fbertola/bgfx-python/master/examples/helloworld/screenshot.png\"\u003e\n\u003c/p\u003e\n\n## Key Features\n\n* Uses [Cppyy](https://cppyy.readthedocs.io/en/latest/) to natively wrap the C++ interface. No _CTypes_ or ugly C interfaces.\n* Unless specified, the GIL is released for every invocation and pointers are passed by reference. This will ensure great overall performances.\n* Maintains the original documentation; use `help()` on a class or function to view it.\n* Compiles shaders on-the-fly, so you don't have to.\n* Ships with [ImGui](https://github.com/ocornut/imgui) integrated in the BGFX rendering pipeline.  \n\n## How To Use\n\n### Precompiled wheels\n\nPrecompiled wheels are available for Windows, Linux and MacOS.\nTo install the latest published release, simply run:\n\n```bash\n$ pip install bgfx-python\n```\n\n### Install from source\n\nTo install the latest version, you'll need to clone this repository and its submodules:\n\n```bash\n$ git clone --depth=1 https://github.com/fbertola/bgfx-python\n$ git submodule update --init --recursive\n```\n\nThen, make sure to have `make`, `cmake` and `ninja` installed in your system.\n\nInstall the required dependency through `poetry`:\n\n```bash\n$ pip install poetry\n$ poetry install\n```\n\nFinally, simply build and install the wheel.\n\n```bash\n$ pip setup.py install\n``` \n\n### Installing on MacOS \n\nBuilding on MacOS X \u003e 10.14 requires you to also install the SDK headers:\n\n```bash\nxcode-select --install\nopen /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg\nexport SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk \n```\n\n### Installing on Windows\n\nThe easiest way is to install [Visual Studio 2017 Community Edition](https://visualstudio.microsoft.com/it/vs/). If you have [Chocolatey](https://chocolatey.org/install) installed, then run:\n\n```bash\nchoco install visualstudio2017community\n```\n\nBefore building the package, make sure to activate all the environment variables required by the compiler:\n\n```bash\ncall \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat\" x86_amd64\n```\n\n## Using ImGUI\n\nTwo modules are exposed:\n* *ImGui*, which provides a standard wrapper around all the ImGui funcions and classes.\n* *ImGuiExtra*, which provides some additional functions to integrate ImGui in the BGFX rendering pipline.\n\nTo use it in your application, simply follow this template:\n\n```python\n# Setup the application\ndef init():\n    ImGuiExtra.create()\n\n# Destroy the application\ndef destroy():\n    ImGuiExtra.destroy()\n\n# Update the application, rendering each fram\ndef update():\n    ImGuiExtra.beginFrame(\n        mouse_x, mouse_y, buttons_states, 0, width, height\n    )\n\n    # Other ImGui drawing directives...\n\n    ImGuiExtra.endFrame()\n```\n\n## Logging\n\n[Loguru](https://github.com/Delgan/loguru) is used for logging inside `bgfx_python`. By default the logger is disabled; to enable it, use the following instructions:\n\n```python\nfrom loguru import logger\n\nlogger.enable(\"bgfx\")\n```\n\n## Examples\n\nYou will find some examples in the `examples` folder, be sure to check them out.\nFor a more advanced example, see the [Natrix](https://github.com/fbertola/Natrix) project.\n\n## Credits\n\nThis software uses the following open source packages:\n\n- [bgfx](https://github.com/bkaradzic/bgfx)\n- [cppyy](https://cppyy.readthedocs.io/en/latest/)\n\n\n[License (BSD 2-clause)](https://raw.githubusercontent.com/fbertola/bgfx-python/master/LICENSE)\n-----------------------------------------------------------------------\n\n\u003ca href=\"http://opensource.org/licenses/BSD-2-Clause\" target=\"_blank\"\u003e\n\u003cimg align=\"right\" src=\"http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png\"\u003e\n\u003c/a\u003e\n\n    BSD 2-Clause License\n    \n    Copyright (c) 2021, Federico Bertola\n    All rights reserved.\n    \n    Redistribution and use in source and binary forms, with or without\n    modification, are permitted provided that the following conditions are met:\n    \n    1. Redistributions of source code must retain the above copyright notice, this\n       list of conditions and the following disclaimer.\n    \n    2. Redistributions in binary form must reproduce the above copyright notice,\n       this list of conditions and the following disclaimer in the documentation\n       and/or other materials provided with the distribution.\n    \n    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n---\n\n\u003e GitHub [@fbertola](https://github.com/fbertola)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbertola%2Fbgfx-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbertola%2Fbgfx-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbertola%2Fbgfx-python/lists"}