Repolode
bkaradzic

bkaradzic/bgfx

A cross-platform C++ rendering library that abstracts over Direct3D, Metal, OpenGL, Vulkan and WebGL so you can bring your own engine.

Stars
17,616
Forks
2,163
Open issues
66
Last commit
16 hours ago

What is it?

bgfx is a rendering library that sits between your application and the graphics API. Instead of writing separate code for Direct3D 11/12, Metal, OpenGL, OpenGL ES, Vulkan and WebGL, developers submit draw calls through one interface and bgfx dispatches them to the backend available on the target platform. It is designed for the "bring your own engine or framework" approach, so it handles rendering rather than providing a full game engine with scene management or asset pipelines.

The library supports Windows, Linux, macOS, iOS, tvOS, Android, Raspberry Pi and WebAssembly via Emscripten, and it ships bindings for languages including C#, Python, Rust, Zig, Java, Go and Lua. The project is licensed under BSD-2-Clause and is used in several shipped games and tools, such as the HARFANG 3D framework and the Crypt of the NecroDancer game.

Key features

  • 01Single API that targets Direct3D 11/12, Metal, OpenGL, OpenGL ES, Vulkan and WebGL.
  • 02Runs on desktop, mobile, console-licensed and web platforms including Wasm/Emscripten.
  • 03Provides language bindings for C#, Python, Rust, Zig, Java, Go, Lua and others.
  • 04Designed to be embedded in existing engines or frameworks rather than replacing them.
  • 05Licensed under BSD-2-Clause.

Use cases

  • Adding multi-backend rendering to a custom game engine or application framework.
  • Building a 3D tool or visualization app that must run on both desktop and mobile.
  • Shipping a graphics layer for browser-based content via WebGL or WebAssembly.
  • Prototyping rendering code in a language with an existing bgfx binding.

Quick start

  1. 1

    Read the official build guide for your platform and compiler

Things to know

  • It is a rendering library, not a full engine, so you must bring your own engine or framework.
  • The GNM backend is only available to licensed PS4 developers.

In collections

Topics

FAQ

What is bgfx?
A cross-platform C++ rendering library that abstracts over Direct3D, Metal, OpenGL, Vulkan and WebGL so you can bring your own engine. bgfx is a rendering library that sits between your application and the graphics API. Instead of writing separate code for Direct3D 11/12, Metal, OpenGL, OpenGL ES, Vulkan and WebGL, developers submit draw calls through one interface and bgfx dispatches them to the backend available on the target platform. It is designed for the "bring your own engine or framework" approach, so it handles rendering rather than providing a full game engine with scene management or asset pipelines.
Is bgfx free to use? What license does it have?
bgfx is open source under the BSD-2-Clause license. Check the license terms before using it in commercial products.
Is bgfx still maintained?
Actively maintained. The last commit to bgfx was on Nov 6, 2026.
What can I use bgfx for?
Adding multi-backend rendering to a custom game engine or application framework. Building a 3D tool or visualization app that must run on both desktop and mobile. Shipping a graphics layer for browser-based content via WebGL or WebAssembly. Prototyping rendering code in a language with an existing bgfx binding.
How do I install bgfx?
Read the official build guide for your platform and compiler
Where can I get bgfx?
The source code and installation instructions are on GitHub: https://github.com/bkaradzic/bgfx

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects