bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
A cross-platform rendering library that lets your game or app draw graphics using a single API instead of writing separate code for DirectX, Metal, Vulkan, OpenGL, and WebGL on each platform.
bgfx is a cross-platform rendering library, written mostly in C and C++. A rendering library is the layer of code in a game or graphics-heavy app that talks to the graphics card and draws pictures on the screen. Each operating system and graphics card vendor exposes its own way of doing this, so software that wants to run everywhere normally has to deal with several systems by hand. bgfx hides those differences behind a single API, so the program above it can ask for triangles, textures, and shaders without caring which underlying system is drawing.
The README calls it a Bring Your Own Engine/Framework style library, meaning it deliberately does not try to be a full game engine. It only does the rendering part, and leaves things like input, audio, and game logic to whatever framework you bring around it. The supported rendering backends include Direct3D 11 and 12, Metal, OpenGL 2.1 and 3.1+, OpenGL ES 2 and 3.1, Vulkan, WebGL 1.0 and 2.0, and WebGPU through Dawn Native, plus GNM for licensed PlayStation 4 developers. Supported platforms include Android, iOS, iPadOS and tvOS, Linux, macOS, PlayStation 4, RaspberryPi, UWP (Universal Windows and Xbox One), Wasm via Emscripten, and Windows. The official API is C/C++ with community bindings for languages such as C#, D, Go, Haskell, Java via LWJGL, Lua, Nim, Pascal, Python, Rust, Swift, Zig, Beef and C3.
You would reach for bgfx when writing a cross-platform game, editor, simulator, or visualizer and you want one consistent rendering API instead of writing separate paths for each platform's native graphics stack. The README highlights games and tools using bgfx, including AirMech, Crown, ioquake3, MAME, and Blackshift.
Where it fits
- Write a cross-platform game that runs on Windows, macOS, iOS, and Android from a single rendering codebase.
- Build a 3D editor or visualizer that works across desktop and browser without platform-specific graphics code.
- Port a graphics app to WebAssembly via Emscripten using bgfx's WebGL or WebGPU backend.
- Use bgfx as the rendering layer in a custom C++ game engine while supplying your own audio, input, and game logic.