All Projects β†’ fbertola β†’ bgfx-python

fbertola / bgfx-python

Licence: BSD-2-Clause license
Python 3.7+ wrapper for the BGFX library. 🐍

Programming Languages

CMake
9771 projects
python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
Batchfile
5799 projects

Projects that are alternatives of or similar to bgfx-python

RavEngine
A fast, easy to use C++20 3D game library for modern computers
Stars: ✭ 122 (+23.23%)
Mutual labels:  metal, vulkan, bgfx, directx
bgfx-header-extension-library
Header-only effects and helper library for Bgfx to help you hit the ground running. Includes a bunch of post processing filters to complete common graphical tasks
Stars: ✭ 35 (-64.65%)
Mutual labels:  metal, vulkan, bgfx, directx
spirv cross
Safe Rust wrapper around SPIRV-Cross
Stars: ✭ 75 (-24.24%)
Mutual labels:  metal, vulkan, directx
Imguizmo.quat
ImGui GIZMO widget - 3D object manipulator / orientator
Stars: ✭ 187 (+88.89%)
Mutual labels:  vulkan, directx, imgui
virtualGizmo3D
Virtual GIZMO - 3D object manipulator / orientator, via mouse, with pan and dolly/zoom features
Stars: ✭ 36 (-63.64%)
Mutual labels:  metal, vulkan, directx
CrossWindow-Demos
πŸ₯ͺ Examples of how to use CrossWindow for things like rendering graphics, listening to events, etc.
Stars: ✭ 48 (-51.52%)
Mutual labels:  metal, vulkan, directx
wgpu-mc
Rust-based replacement for the default Minecraft renderer
Stars: ✭ 254 (+156.57%)
Mutual labels:  metal, vulkan, directx
Crossshader
βš”οΈ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.
Stars: ✭ 113 (+14.14%)
Mutual labels:  metal, vulkan, directx
Bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+10255.56%)
Mutual labels:  metal, vulkan, directx
Llgl
Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
Stars: ✭ 1,011 (+921.21%)
Mutual labels:  metal, vulkan, directx
MoravaEngine
2D/3D graphics engine written in C++ language. It currently supports the following graphics APIs: OpenGL 3.3+, Vulkan 1.2, DirectX 11. Its current purpose is to experiment with various CG concepts and techniques.
Stars: ✭ 129 (+30.3%)
Mutual labels:  vulkan, directx, imgui
LowLevelAPIDemo
Evergine Low-Level API samples.
Stars: ✭ 12 (-87.88%)
Mutual labels:  metal, vulkan, directx
CrossWindow-Graphics
A header only library to simplify creating πŸŒ‹ Vulkan / βšͺ OpenGL / 🌐 WebGL / ❎DirectX / πŸ€– Metal data structures with CrossWindow.
Stars: ✭ 48 (-51.52%)
Mutual labels:  metal, vulkan, directx
Fiber2d
Cross-platform 2D Game Engine in pure Swift
Stars: ✭ 415 (+319.19%)
Mutual labels:  metal, vulkan, directx
The Forge
The Forge Cross-Platform Rendering Framework PC Windows, Linux, Ray Tracing, macOS / iOS, Android, XBOX, PS4, PS5, Switch, Quest 2
Stars: ✭ 2,710 (+2637.37%)
Mutual labels:  metal, vulkan, directx
harfang3d
HARFANG 3D source code public repository
Stars: ✭ 173 (+74.75%)
Mutual labels:  vulkan, bgfx, directx
Explosion
πŸ’₯ A modern cross-platform game engine (WIP)
Stars: ✭ 102 (+3.03%)
Mutual labels:  metal, vulkan
Mg
C# Vulkan interface/polyfill for WINDOWS and MacOS
Stars: ✭ 19 (-80.81%)
Mutual labels:  metal, vulkan
wgpu-py
Next generation GPU API for Python
Stars: ✭ 210 (+112.12%)
Mutual labels:  metal, vulkan
rapp
Cross-platform entry point library
Stars: ✭ 57 (-42.42%)
Mutual labels:  bgfx, imgui


BGFX Python

Python 3.7+ wrapper for the BGFX library.



Key Features β€’ How To Use β€’ β€’ Using ImGUI β€’ Examples β€’ Logging β€’ Credits β€’ License

Key Features

  • Uses Cppyy to natively wrap the C++ interface. No CTypes or ugly C interfaces.
  • Unless specified, the GIL is released for every invocation and pointers are passed by reference. This will ensure great overall performances.
  • Maintains the original documentation; use help() on a class or function to view it.
  • Compiles shaders on-the-fly, so you don't have to.
  • Ships with ImGui integrated in the BGFX rendering pipeline.

How To Use

Precompiled wheels

Precompiled wheels are available for Windows, Linux and MacOS. To install the latest published release, simply run:

$ pip install bgfx-python

Install from source

To install the latest version, you'll need to clone this repository and its submodules:

$ git clone --depth=1 https://github.com/fbertola/bgfx-python
$ git submodule update --init --recursive

Then, make sure to have make, cmake and ninja installed in your system.

Install the required dependency through poetry:

$ pip install poetry
$ poetry install

Finally, simply build and install the wheel.

$ pip setup.py install

Installing on MacOS

Building on MacOS X > 10.14 requires you to also install the SDK headers:

xcode-select --install
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk 

Installing on Windows

The easiest way is to install Visual Studio 2017 Community Edition. If you have Chocolatey installed, then run:

choco install visualstudio2017community

Before building the package, make sure to activate all the environment variables required by the compiler:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64

Using ImGUI

Two modules are exposed:

  • ImGui, which provides a standard wrapper around all the ImGui funcions and classes.
  • ImGuiExtra, which provides some additional functions to integrate ImGui in the BGFX rendering pipline.

To use it in your application, simply follow this template:

# Setup the application
def init():
    ImGuiExtra.create()

# Destroy the application
def destroy():
    ImGuiExtra.destroy()

# Update the application, rendering each fram
def update():
    ImGuiExtra.beginFrame(
        mouse_x, mouse_y, buttons_states, 0, width, height
    )

    # Other ImGui drawing directives...

    ImGuiExtra.endFrame()

Logging

Loguru is used for logging inside bgfx_python. By default the logger is disabled; to enable it, use the following instructions:

from loguru import logger

logger.enable("bgfx")

Examples

You will find some examples in the examples folder, be sure to check them out. For a more advanced example, see the Natrix project.

Credits

This software uses the following open source packages:

License (BSD 2-clause)

BSD 2-Clause License

Copyright (c) 2021, Federico Bertola
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

GitHub @fbertola

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].