# bgfx

Cross\-platform rendering library that abstracts multiple graphics APIs for custom engines\.

ID: Q1243 · Revision: 1291

Type: software · License: BSD\-2\-Clause for bgfx; dependencies, bindings and bundled third\-party components retain their respective terms\.[^license] · Status: active

Website: https://bkaradzic.github.io/bgfx/



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\.[^overview][^build]

## 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\.[^overview]

## 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\.[^api][^internals]

## 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\.[^overview][^internals]

## 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\.[^tools]

## 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\.[^build]

## 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\.[^license][^overview][^build]

## Substitution considerations

bgfx can be considered instead of the GPU rendering API in [SDL](/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\.[^api][^tools][^sdl][^overview]

## Capabilities and substitutions

### Multiple rendering backends — supported

Documented backends include Direct3D, Metal, OpenGL/OpenGL ES, Vulkan and WebGL; the listed WebGPU route is Dawn Native only\.[^overview]

Use case: Implementing a cross\-platform renderer inside a custom game or graphics application · Platforms: Windows, macOS, Linux, Android, iOS, tvOS, Web · Region: Version, build and integration requirements apply

### View\-based draw ordering — supported

Draw calls are grouped into views; sequential mode preserves submission order where required, such as UI rendering\.[^api]

Use case: Implementing a cross\-platform renderer inside a custom game or graphics application · Platforms: Windows, macOS, Linux, Android, iOS, tvOS, Web · Region: Version, build and integration requirements apply

### Cross\-platform shader processing — limited

Shaderc compiles a GLSL\-like dialect with its own conventions and target profiles; arbitrary existing shaders are not automatically interchangeable\.[^tools]

Use case: Implementing a cross\-platform renderer inside a custom game or graphics application · Platforms: Windows, macOS, Linux, Android, iOS, tvOS, Web · Region: Version, build and integration requirements apply

### Window\-library integration — limited

SDL or GLFW can supply native window handles; custom integration must respect platform rendering and thread requirements\.[^overview]

Use case: Implementing a cross\-platform renderer inside a custom game or graphics application · Platforms: Windows, macOS, Linux, Android, iOS, tvOS, Web · Region: Version, build and integration requirements apply

### [Substitute for SDL](/sdl) — limited

Assessment: a substitute for SDL3's GPU rendering layer when a custom application prefers bgfx's view\-based submission model and backend set\. SDL can remain in use for windows, input and audio\. This relationship does not replace SDL as a whole or imply shader/API compatibility\.[^overview][^api][^sdl]

Use case: Implementing a cross\-platform renderer inside a custom game or graphics application · Platforms: Windows, macOS, Linux, Android, iOS, tvOS, Web · Region: Version, build and integration requirements apply

## References

[^overview]: [bgfx overview](<https://bkaradzic.github.io/bgfx/overview.html>) — Rendering\-library scope, backends, platforms and SDL/GLFW integration (vendor; retrieved 2026-10-07T19:48:46Z)

[^internals]: [bgfx internals](<https://bkaradzic.github.io/bgfx/internals.html>) — Sorted draw submission, API/render threading and frame buffering (vendor; retrieved 2026-10-07T19:49:25Z)

[^api]: [bgfx API reference](<https://bkaradzic.github.io/bgfx/bgfx.html>) — Views, sequential ordering and encoder threading (vendor; retrieved 2026-10-07T19:52:24Z)

[^tools]: [bgfx tools](<https://bkaradzic.github.io/bgfx/tools.html>) — Shaderc dialect, geometryc inputs and texturec (vendor; retrieved 2026-10-07T19:50:24Z)

[^build]: [Building bgfx](<https://bkaradzic.github.io/bgfx/build.html>) — bx/bimg dependencies, project generation and amalgamated integration (vendor; retrieved 2026-10-07T19:50:47Z)

[^license]: [bgfx license](<https://github.com/bkaradzic/bgfx/blob/master/LICENSE>) — BSD two\-clause source and binary redistribution terms (vendor; retrieved 2026-10-07T19:50:47Z)

[^sdl]: [SDL3 GPU API](<https://wiki.libsdl.org/SDL3/CategoryGPU>) — Graphics/compute abstraction, command buffers and backend shaders (vendor; retrieved 2026-10-07T19:50:24Z)

Source revision: https://substitutefor.net/entities/Q1243?revision=1291
