# bgfx: A Bring-Your-Own-Engine Rendering Library Across Nine Platforms

> bgfx is a BSD-2-Clause C++ rendering library that abstracts over nine graphics backends including Vulkan, Metal, Direct3D 11 and 12, WebGL 2.0, and WebGPU, running on nine platforms from Windows and macOS to Android, iOS, Wasm, and Raspberry Pi. It is explicitly designed to be integrated into a custom engine or framework rather than used as a standalone tool.

**bkaradzic/bgfx** — Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.

- Repository: https://github.com/bkaradzic/bgfx
- Website: https://bkaradzic.github.io/bgfx/overview.html
- Stars: 17,530 · Forks: 2,144
- Language: C++
- License: BSD-2-Clause
- Published: 2026-09-21 · Updated: 2026-09-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/bkaradzic-bgfx

## What bgfx Is and What It Deliberately Excludes

bgfx is described as a cross-platform, graphics API agnostic rendering library with a "Bring Your Own Engine/Framework" design. That phrase is not marketing; it is a precise description of the architectural boundary. bgfx provides a rendering abstraction. It does not provide a scene graph, an entity-component system, a physics engine, an asset pipeline, an audio layer, or a window manager. Every one of those is the developer's responsibility.

The intended user is an engine or framework author who needs to write rendering code once and deploy it across many graphics APIs and platforms. Rather than maintaining separate Vulkan, Metal, and Direct3D 11 code paths, the developer writes against the bgfx API and bgfx dispatches to the correct backend at runtime or compile time.

This design philosophy makes bgfx genuinely useful for a specific class of projects: custom engines, middleware libraries, game tool developers, emulator frontends, and research renderers. The README's #madewithbgfx section lists actual shipped products using bgfx: AirMech Strike by Carbon Games, ioquake3's rendering layer, MAME (the Multiple Arcade Machine Emulator), the Crown game engine, and several others. These are production uses, not toy projects.

## Graphics Backends: Nine APIs Including WebGPU and the PS4 GNM

bgfx supports nine rendering backends as of the current README:

Direct3D 11, Direct3D 12, Metal, OpenGL 4.3 and above, OpenGL ES 3.0 and above, Vulkan, WebGL 2.0, WebGPU (Dawn Native only), and GNM for PlayStation 4.

Three of these carry notable constraints. The PS4 GNM backend source is not available in the public repository; it is distributed only to licensed PS4 developers through Sony's DevNet forums. The WebGPU backend targets Dawn Native specifically, not the browser's navigator.gpu interface or other WebGPU implementations. And OpenGL 4.3 is the minimum version, which excludes older hardware on macOS (Apple dropped OpenGL support as a platform-level choice) and legacy embedded GPUs.

The OpenGL ES 3.0 path is separate from desktop OpenGL and covers the Android and iOS GPU market. Metal covers iOS, iPadOS, tvOS, and macOS 13.0 and above. The practical effect is that bgfx can run a single shader and draw call model across a mobile device on OpenGL ES 3.0, a desktop on Vulkan, a macOS machine on Metal, and a browser on WebGL 2.0 without the calling code changing.

Shader compilation is handled by a custom shader language and compiler that ships with bgfx. The compiled output targets the appropriate backend's shader format. The tools directory in the repository contains this toolchain.

## Platform and Compiler Coverage

bgfx targets nine platforms: Android 4.0 and above (API level 14), iOS, iPadOS, and tvOS 16.0 and above, Linux, macOS 13.0 and above, PlayStation 4, Raspberry Pi, UWP and Xbox One, Wasm via Emscripten, and Windows 7 and above.

The supported compilers are Clang 11 and above, GCC 11 and above, Visual Studio 2022 and above, and Apple clang 12 and above. These version requirements are non-trivial for teams maintaining older build environments. GCC 11 requires at least Ubuntu 22.04 LTS or equivalent. VS2022 is the minimum, meaning VS2019 is not supported.

The repository provides pre-built examples accessible at bkaradzic.github.io/bgfx/examples.html. These run in the browser via the WebGL 2.0 backend and give a concrete preview of what the library can render without requiring a local build. The 25 example programs in the examples/ directory cover basic geometry (00-helloworld, 01-cubes), advanced techniques (09-hdr, 18-ibl, 21-deferred), compute examples (24-nbody), and platform integration patterns.

Build documentation is at bkaradzic.github.io/bgfx/build.html. The repository root contains a makefile (lowercase) and a .pre-commit-config.yaml, indicating it uses both make and pre-commit hooks for development tooling. The CI configuration is in .github/.

## Language Bindings: C/C++ Core with Fourteen Other Language Wrappers

The primary API is C and C++, documented at bkaradzic.github.io/bgfx/bgfx.html. Several language bindings are maintained in the bindings/ directory within the bgfx repository itself: Beef, C#, C3, Python, and Zig.

A further nine bindings are maintained by the community in external repositories: D (bindbc-bgfx), Go (james4k/go-bgfx), Haskell (haskell-game/bgfx), Java via LWJGL3, Lua (cloudwu/lua-bgfx), Nim (puffball1567/bgfxim), Pascal (PasBGFX), Rust (emoon/bgfx-rs), and Swift (stuartcarnie/SwiftBGFX).

The distinction between in-tree and external bindings matters for maintenance. Bindings maintained inside the bgfx repository are updated alongside the C++ API. External bindings may lag behind when the API changes. The Rust binding (bgfx-rs) is labeled as "new" in the README, which suggests it was added more recently than the others and may have less coverage of the full API.

For teams using bgfx with a language other than C or C++, verifying that the binding tracks the current API version is a concrete prerequisite before adopting it. The C# binding in bindings/cs is in-tree and likely the most maintained non-C++ option after Zig and Beef.

## Where bgfx Is the Wrong Tool

bgfx is genuinely not the right starting point for several categories of projects.

Developers who want a complete game engine should look elsewhere. bgfx provides no window creation, no input handling, no audio, no physics, no scene management, and no asset pipeline. Using bgfx alone means implementing or sourcing all of those independently. The Crown engine and Torque6, both listed in the README's #madewithbgfx section, show what this looks like in practice: they are complete engines that use bgfx as their rendering layer among many other components.

Developers targeting the web with a browser's native WebGPU API will find that bgfx's WebGPU backend is limited to Dawn Native. This matters for projects that want to publish a browser game without a native binary; WebGL 2.0 remains the supported browser target.

The PS4 backend requires a licensed Sony developer account. Teams without PS4 developer status cannot access the GNM backend source and cannot ship a PS4 title using the public repository alone.

Finally, macOS users need to note the macOS 13.0 minimum. The Metal backend requires macOS 13 or later. The OpenGL path on macOS is not listed as supported, which Apple's own deprecation of OpenGL makes consistent. macOS 12 and earlier are not covered by any listed backend.

## Maintenance, License, and Production Use

bgfx is distributed under the BSD-2-Clause license. This is a permissive license with no copyleft requirement, which is a practical choice for a rendering library: it lets developers link bgfx into commercial products without obligation to open-source their own code. The repository has no GitHub releases; the master branch is the distribution channel, and teams typically pin to a specific commit.

The last push to the repository was on 2026-09-26, indicating recent activity. The project has no formal release tagging, which means tracking breaking API changes requires reading the commit history or the CHANGELOG rather than relying on a versioned release.

The repository's CODEOWNERS file and the GitHub Actions CI (listed in the README) indicate an organized maintenance process. The .pre-commit-config.yaml suggests code quality checks are automated at commit time.

The #madewithbgfx section in the README lists shipping products including AirMech Strike (Carbon Games), MAME, ioquake3's renderer, and Blackshift (a Steam-listed puzzle game). These demonstrate that the library is used in production across commercial games, emulators, and tools, not only in research or hobby contexts.

## Conclusion

bgfx is the right choice for developers building a custom engine or framework who need a single rendering abstraction across Vulkan, Metal, Direct3D 11 and 12, OpenGL, WebGL 2.0, and WebGPU without writing backend-specific code. It is the wrong choice for anyone who wants a ready-made scene graph, physics integration, ECS, or asset pipeline; none of those exist in bgfx by design. Before committing, verify that your target platform's backend is in the supported list: WebGPU support is currently limited to Dawn Native, and the PS4 GNM backend requires a licensed Sony developer account with access to the DevNet forums for the source.

## FAQ

### What is bgfx?

bgfx is a BSD-2-Clause C++ rendering library that abstracts over nine graphics APIs (Vulkan, Metal, Direct3D 11 and 12, OpenGL 4.3+, OpenGL ES 3.0+, WebGL 2.0, WebGPU via Dawn Native, and PS4 GNM) across nine platforms. It is designed to be embedded in a custom engine or framework rather than used standalone.

### What are some alternatives to bgfx?

The README does not name alternatives. bgfx differs from full game engines (Unity, Unreal, Godot) by providing only the rendering abstraction layer without a scene graph, physics, or ECS; developers using bgfx must supply those themselves. Full game engines bundle those systems, which reduces flexibility but lowers the integration cost for standard use cases.

### What language bindings does bgfx provide?

bgfx ships in-tree bindings for Beef, C#, C3, Python, and Zig in its bindings/ directory alongside the core C/C++ API. External community bindings exist for D, Go, Haskell, Java (LWJGL3), Lua, Nim, Pascal, Rust, and Swift, though these are maintained in separate repositories and may not track the latest API.

## Sources

- [bkaradzic/bgfx on GitHub](https://github.com/bkaradzic/bgfx)
- [Issues](https://github.com/bkaradzic/bgfx/issues)
- [License: BSD-2-Clause](https://github.com/bkaradzic/bgfx/blob/master/LICENSE)
- [Project website](https://bkaradzic.github.io/bgfx/overview.html)
- [README](https://github.com/bkaradzic/bgfx/blob/master/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/bkaradzic-bgfx
