Overview¶
What is it?¶
Cross-platform, graphics API agnostic, “Bring Your Own Engine/Framework” style rendering library, licensed under permissive BSD-2 clause open source license.
Supported rendering backends¶
- Direct3D 9
- Direct3D 11
- Direct3D 12
- Metal (WIP)
- OpenGL 2.1
- OpenGL 3.1+
- OpenGL ES 2
- OpenGL ES 3.1
- WebGL 1.0
- WebGL 2.0
Supported HMD¶
- OculusVR (1.3.0)
Supported Platforms¶
- Android (14+, ARM, x86, MIPS)
- asm.js/Emscripten (1.25.0)
- FreeBSD
- iOS (iPhone, iPad, AppleTV)
- Linux
- MIPS Creator CI20
- OSX (10.9+)
- RaspberryPi
- SteamLink
- Windows (XP, Vista, 7, 8, 10)
- WinRT (WinPhone 8.0+)
Supported Compilers¶
- Clang 3.3 and above
- GCC 4.6 and above
- vs2015 and above
Supported Languages¶
- C/C++ API documentation
- C#/VB/F# language API bindings
- D language API bindings
- Go language API bindings
- Haskell language API bindings
- Lightweight Java Game Library 3 bindings
- Lua language API bindings 1
- Lua language API bindings 2
- Nim language API bindings
- Python language API bindings
- Rust language API bindings
- Swift language API bindings
Project Page¶
Contact¶
- Twitter @bkaradzic
- GitHub @bkaradzic
Debugging and Profiling¶
RenderDoc¶
Loading of RenderDoc is integrated in bgfx when using DX11 or OpenGL
renderer. You can drop in renderdoc.dll from RenderDoc distribution
into working directory, and it will be automatically loaded during bgfx
initialization. This allows frame capture at any time by pressing
F11.
Download: RenderDoc
RenderDoc How do I ...? documentation.
IntelGPA¶
Right click Intel GPA Monitor tray icon, choose preferences, check
“Auto-detect launched applications” option. Find InjectionList.txt
in GPA directory and add examples-* to the list.
Download: IntelGPA
Other Debuggers and Profilers¶
| Name | OS | DX9 | DX11 | DX12 | Metal | GL | GLES | Vulkan | Source |
|---|---|---|---|---|---|---|---|---|---|
| APITrace | Linux/OSX/Win | ✓ | ✓ | ✓ | ✓ | ✓ | |||
| CodeXL | Linux/Win | ✓ | |||||||
| Dissector | Win | ✓ | ✓ | ||||||
| IntelGPA | Linux/OSX/Win | ✓ | ✓ | ✓ | |||||
| Nsight | Win | ✓ | ✓ | ✓ | |||||
| PerfHUD | Win | ✓ | ✓ | ||||||
| PerfStudio | Win | ✓ | ✓ | ✓ | ✓ | ||||
| PIX | Win | ✓ | |||||||
| RGP | Win | ✓ | ✓ | ||||||
| RenderDoc | Win/Linux | ✓ | ✓ | ✓ | ✓ | ||||
| vogl | Linux | ✓ | ✓ |
Download:
SDL, GLFW, etc.¶
It is possible to use bgfx with SDL, GLFW and similar cross platform windowing libraries. The main requirement is that windowing library provides access to native window handle that’s used to create Direct3D device or OpenGL context.
For more info see: API Reference.
Note
You can use --with-sdl when runnning GENie to enable SDL2 integration with examples:
genie --with-sdl vs2012
Note
--with-glfw is also available, but it’s just simple stub to be used to test GLFW
integration API.
Note
Special care is necessary to make custom windowing to work with multithreaded renderer.
Each platform has rules about where renderer can be and how multithreading interacts
with context/device. To disable multithreaded render use BGFX_CONFIG_MULTITHREDED=0
preprocessor define.
Getting Involved¶
Everyone is welcome to contribute to bgfx by submitting bug reports, testing on different platforms, writing examples, improving documentation, profiling and optimizing, etc.
Note
When contributing to the bgfx project you must agree to the BSD 2-clause licensing terms.
Contributors¶
Chrnonological order:
- Branimir Karadžić (@bkaradzic)
- Garett Bass (@gtbass) - OSX port.
- Jeremie Roy (@jeremieroy) - Font system and examples.
- Miloš Tošić (@milostosic) - 12-lod example.
- Dario Manesku (@dariomanesku) - 13-stencil, 14-shadowvolumes, 15-shadowmaps-simple, 16-shadowmaps, 18-ibl, 28-wireframe.
- James Gray (@james4k) - Go language API bindings.
- Guillaume Piolat (@p0nce) - D language API bindings.
- Mike Popoloski (@MikePopoloski) - C#/VB/F# language API bindings, WinRT/WinPhone support.
- Kai Jourdan (@questor) - 23-vectordisplay example
- Stanlo Slasinski (@stanlo) - 24-nbody example
- Daniel Collin (@emoon) - Port of Ocornut’s ImGui to bgfx.
- Andre Weissflog (@floooh) - Alternative build system fips.
- Andrew Johnson (@ajohnson23) - TeamCity build.
- Tony McCrary (@enleeten) - Java language API bindings.
- Attila Kocsis (@attilaz) - Metal rendering backend, various OSX and iOS improvements and bug fixes.
- Richard Gale (@RichardGale) - Emscripten entry input handling.
- Andrew Mac (@andr3wmac) - 27-terrain.
- Oliver Charles (@ocharles) - Haskel language API bindings.
- Johan Sköld (@rhoot) - Rust language API bindings.
- Jean-François Verdon (@Nodrev) - Alternative deployment for Android.
- Jason Nadro (@jnadro) - Python language API bindings.
- Krzysztof Kondrak (@kondrak) - OculusVR integration.
- Colby Klein (@excessive) - Lua language API bindings.
- Stuart Carnie (@stuartcarnie) - Swift language API bindings.
- Joseph Cherlin (@jcherlin) - 30-picking, and 31-rsm example.
- Olli Wang (@olliwang) - Various NanoVG integration improvements.
- Cory Golden (@Halsys) - Nim language API bindings.
- Camilla Berglund (@elmindreda) - GLFW support.
- Daniel Ludwig (@code-disaster) - Lightweight Java Game Library 3 bindings.
- Benoit Jacquier (@benoitjacquier) - Added support for cubemap as texture 2D array in a compute shader.
- Apoorva Joshi (@ApoorvaJ) - 33-pom example.
- Stanislav Pidhorsky (@podgorskiy) - 36-sky example.
- 云风 (@cloudwu) - Alternative Lua bindings.
Repository visualization¶