{"schemaVersion":"1.0","record":{"label":"bgfx","description":"Cross-platform rendering library that abstracts multiple graphics APIs for custom engines.","aliases":[],"kind":"software","website":"https://bkaradzic.github.io/bgfx/","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.","license":"BSD-2-Clause for bgfx; dependencies, bindings and bundled third-party components retain their respective terms.","lifecycle":"active","example":false,"features":[{"name":"Multiple rendering backends","status":"supported","detail":"Documented backends include Direct3D, Metal, OpenGL/OpenGL ES, Vulkan and WebGL; the listed WebGPU route is Dawn Native only.","useCase":"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","evidence":[{"url":"https://bkaradzic.github.io/bgfx/overview.html","locator":"Rendering-library scope, backends, platforms and SDL/GLFW integration","retrievedAt":"2026-10-07T19:48:46Z","kind":"vendor"}]},{"name":"View-based draw ordering","status":"supported","detail":"Draw calls are grouped into views; sequential mode preserves submission order where required, such as UI rendering.","useCase":"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","evidence":[{"url":"https://bkaradzic.github.io/bgfx/bgfx.html","locator":"Views, sequential ordering and encoder threading","retrievedAt":"2026-10-07T19:52:24Z","kind":"vendor"}]},{"name":"Cross-platform shader processing","status":"limited","detail":"Shaderc compiles a GLSL-like dialect with its own conventions and target profiles; arbitrary existing shaders are not automatically interchangeable.","useCase":"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","evidence":[{"url":"https://bkaradzic.github.io/bgfx/tools.html","locator":"Shaderc dialect, geometryc inputs and texturec","retrievedAt":"2026-10-07T19:50:24Z","kind":"vendor"}]},{"name":"Window-library integration","status":"limited","detail":"SDL or GLFW can supply native window handles; custom integration must respect platform rendering and thread requirements.","useCase":"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","evidence":[{"url":"https://bkaradzic.github.io/bgfx/overview.html","locator":"Rendering-library scope, backends, platforms and SDL/GLFW integration","retrievedAt":"2026-10-07T19:48:46Z","kind":"vendor"}]}],"alternatives":[],"slug":"bgfx","draftAlternatives":[{"targetSlug":"sdl","status":"limited","detail":"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.","useCase":"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","evidence":[{"url":"https://bkaradzic.github.io/bgfx/overview.html","locator":"Rendering-library scope, backends, platforms and SDL/GLFW integration","retrievedAt":"2026-10-07T19:48:46Z","kind":"vendor"},{"url":"https://bkaradzic.github.io/bgfx/bgfx.html","locator":"Views, sequential ordering and encoder threading","retrievedAt":"2026-10-07T19:52:24Z","kind":"vendor"},{"url":"https://wiki.libsdl.org/SDL3/CategoryGPU","locator":"Graphics/compute abstraction, command buffers and backend shaders","retrievedAt":"2026-10-07T19:50:24Z","kind":"vendor"}]}],"evidence":[{"url":"https://bkaradzic.github.io/bgfx/overview.html","locator":"Rendering-library scope, backends, platforms and SDL/GLFW integration","retrievedAt":"2026-10-07T19:48:46Z","kind":"vendor"},{"url":"https://bkaradzic.github.io/bgfx/internals.html","locator":"Sorted draw submission, API/render threading and frame buffering","retrievedAt":"2026-10-07T19:49:25Z","kind":"vendor"},{"url":"https://bkaradzic.github.io/bgfx/bgfx.html","locator":"Views, sequential ordering and encoder threading","retrievedAt":"2026-10-07T19:52:24Z","kind":"vendor"},{"url":"https://bkaradzic.github.io/bgfx/tools.html","locator":"Shaderc dialect, geometryc inputs and texturec","retrievedAt":"2026-10-07T19:50:24Z","kind":"vendor"},{"url":"https://bkaradzic.github.io/bgfx/build.html","locator":"bx/bimg dependencies, project generation and amalgamated integration","retrievedAt":"2026-10-07T19:50:47Z","kind":"vendor"},{"url":"https://github.com/bkaradzic/bgfx/blob/master/LICENSE","locator":"BSD two-clause source and binary redistribution terms","retrievedAt":"2026-10-07T19:50:47Z","kind":"vendor"},{"url":"https://wiki.libsdl.org/SDL3/CategoryGPU","locator":"Graphics/compute abstraction, command buffers and backend shaders","retrievedAt":"2026-10-07T19:50:24Z","kind":"vendor"}],"document":{"version":1,"references":[{"url":"https://bkaradzic.github.io/bgfx/overview.html","locator":"Rendering-library scope, backends, platforms and SDL/GLFW integration","retrievedAt":"2026-10-07T19:48:46Z","id":"overview","title":"bgfx overview","kind":"vendor"},{"url":"https://bkaradzic.github.io/bgfx/internals.html","locator":"Sorted draw submission, API/render threading and frame buffering","retrievedAt":"2026-10-07T19:49:25Z","id":"internals","title":"bgfx internals","kind":"vendor"},{"url":"https://bkaradzic.github.io/bgfx/bgfx.html","locator":"Views, sequential ordering and encoder threading","retrievedAt":"2026-10-07T19:52:24Z","id":"api","title":"bgfx API reference","kind":"vendor"},{"url":"https://bkaradzic.github.io/bgfx/tools.html","locator":"Shaderc dialect, geometryc inputs and texturec","retrievedAt":"2026-10-07T19:50:24Z","id":"tools","title":"bgfx tools","kind":"vendor"},{"url":"https://bkaradzic.github.io/bgfx/build.html","locator":"bx/bimg dependencies, project generation and amalgamated integration","retrievedAt":"2026-10-07T19:50:47Z","id":"build","title":"Building bgfx","kind":"vendor"},{"url":"https://github.com/bkaradzic/bgfx/blob/master/LICENSE","locator":"BSD two-clause source and binary redistribution terms","retrievedAt":"2026-10-07T19:50:47Z","id":"license","title":"bgfx license","kind":"vendor"},{"url":"https://wiki.libsdl.org/SDL3/CategoryGPU","locator":"Graphics/compute abstraction, command buffers and backend shaders","retrievedAt":"2026-10-07T19:50:24Z","id":"sdl","title":"SDL3 GPU API","kind":"vendor"}],"overviewCitations":["overview","build"],"licenseCitations":["license"],"sections":[{"id":"scope","heading":"Rendering scope","paragraphs":[{"id":"scope-detail","content":[{"text":"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."}],"citations":["overview"]}]},{"id":"views","heading":"Views and ordering","paragraphs":[{"id":"views-detail","content":[{"text":"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."}],"citations":["api","internals"]}]},{"id":"threads","heading":"Integration and threading","paragraphs":[{"id":"threads-detail","content":[{"text":"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."}],"citations":["overview","internals"]}]},{"id":"assets","heading":"Shaders and assets","paragraphs":[{"id":"assets-detail","content":[{"text":"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."}],"citations":["tools"]}]},{"id":"build","heading":"Build workflow","paragraphs":[{"id":"build-detail","content":[{"text":"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."}],"citations":["build"]}]},{"id":"licensing","heading":"Licensing","paragraphs":[{"id":"licensing-detail","content":[{"text":"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."}],"citations":["license","overview","build"]}]},{"id":"comparison","heading":"Substitution considerations","paragraphs":[{"id":"comparison-detail","content":[{"text":"bgfx can be considered instead of the GPU rendering API in "},{"text":"SDL","targetSlug":"sdl"},{"text":" 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."}],"citations":["api","tools","sdl","overview"]}]}]},"id":"Q1243","revision":1291,"updatedAt":"2026-10-14T01:10:48Z","sourceUrl":"https://substitutefor.net/entities/Q1243?revision=1291"}}