bgfx Cross-platform rendering library that abstracts multiple graphics APIs for custom engines.
Overview bgfx is a cross-platform rendering library for applications that supply their own engine or framework. It presents a graphics-API abstraction over several native and web backends, with C/C++ interfaces and separately maintained language bindings. The application still supplies systems such as its game architecture, window integration and asset workflow.[1] [5]
Contents Rendering scope The project describes bgfx as a rendering component to combine with an application's own framework. Its backend list spans desktop, mobile and WebGL APIs, but individual platform and graphics requirements still apply. The documented WebGPU entry is specifically Dawn Native, so that listing should not be expanded into a claim of general browser WebGPU support.[1]
Views and ordering Views group draw and compute submissions into rendering passes. Draw order is not necessarily the order of API calls: the renderer can sort submissions to reduce state changes. Sequential mode preserves order for cases such as interface painting, while other modes use program or depth ordering. A renderer port must therefore preserve the intended visual dependencies explicitly rather than assume an immediate-mode execution model.[2] [3]
Integration and threading bgfx can work with window libraries such as SDL or GLFW when they expose the native handles needed by the selected graphics backend. Its internal design separates API-side submission from rendering work, with a buffered frame pipeline. Custom window integration needs to respect the host platform's context and threading rules; using a portable rendering abstraction does not remove these integration responsibilities.[1] [2]
Shaders and assets Shaderc processes a GLSL-like language with bgfx-specific conventions, including declared input/output semantics and helper macros. Existing shader code may need adaptation and compilation for the selected target profile. Companion tools include geometryc for OBJ and glTF mesh inputs and texturec for texture conversion. These utilities provide pieces of a content pipeline, rather than establishing lossless import of another engine's full scenes or materials.[4]
Build workflow The documented source build uses the companion bx and bimg repositories and generates platform projects through GENie or its makefile wrappers. An amalgamated source route is also described for integrating the library into another build system. Developers choose the platform configuration and tools they need, and must keep those choices aligned with the renderer and shader assets shipped in the application.[5]
Licensing bgfx uses the BSD two-clause license. Source redistribution preserves its notices and conditions, while binary distribution reproduces them in accompanying materials. The license covers the library rather than all possible assets, language bindings or dependencies chosen by an application. Those components require their own review when assembling a distributable product.[1] [5] [6]
Substitution considerations bgfx can be considered instead of the GPU rendering API in SDL for a custom renderer. SDL3 GPU exposes command buffers, render passes and backend-specific shaders; bgfx uses its own resources, views and shader pipeline. Choosing between them involves porting rendering code and validating required features, not swapping compatible binaries. SDL may still supply the same application's windowing, input or audio, so the substitution applies only to its rendering layer.[1] [3] [4] [7]
References bgfx overview Rendering-library scope, backends, platforms and SDL/GLFW integration
vendor · retrieved 2026-10-07 bgfx internals Sorted draw submission, API/render threading and frame buffering
vendor · retrieved 2026-10-07 bgfx API reference Views, sequential ordering and encoder threading
vendor · retrieved 2026-10-07 bgfx tools Shaderc dialect, geometryc inputs and texturec
vendor · retrieved 2026-10-07 Building bgfx bx/bimg dependencies, project generation and amalgamated integration
vendor · retrieved 2026-10-07 bgfx license BSD two-clause source and binary redistribution terms
vendor · retrieved 2026-10-07 SDL3 GPU API Graphics/compute abstraction, command buffers and backend shaders
vendor · retrieved 2026-10-07 Also included: 4 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.