bindbc-bgfx 0.8.0+118

Dynamic and static D bindings for bgfx.

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:


Dynamic and static D bindings for bgfx.

These bindings target bgfx API version 115 (commit d95a643603e5b1dbe847d622ffb5860765ee7f62).

Usage (DUB)

To install this library with DUB, simply run the following command:

dub add bindbc-bgfx

The library is configured to dynamic configuration by default, and should work out of box if you have the dynamic library installed properly (e.g. on Windows, the .DLL files are accessible by the application).

Static bindings

For static linking, static configuration must be enabled:


"subConfigurations": {
	"bindbc-bgfx": "static"

"libs": [
	"bgfxRelease", "bxRelease", "bimgRelease"

Make sure to link against all the necessary system libraries needed by bgfx, and setup the library paths for linker:

"libs-windows": [
	"User32", "Gdi32"
"lflags-windows": [

"libs-linux": [
	"stdc++", "GL", "X11"
"lflags-linux": [

The bindings also support -betterC, which can be enabled with staticBC and dynamicBC configurations.


import bindbc.bgfx;

loadBgfx(); // required with dynamically linked bgfx

bgfx_init_t init;

bgfx_reset(1280, 720, BGFX_RESET_NONE, init.resolution.format);


unloadBgfx(); // optional, only needed with dynamically linked bgfx

This is a very simple sample of how to use these bindings with bgfx. The sample code does not render or output anything but merely demonstrates how the bindings are initialized for proper use. To setup a window, libraries like SDL2 are often used with bgfx to provide the window for bgfx to use with rendering. Please see this C++ example on how to setup bgfx with SDL2.

If you need more in-depth tutorial of how to use bgfx, please see the bgfx examples here.

Generating bindings

The main bgfx repository already contains the latest generated binding definitions for D, so these files can be copied from bgfx/bindings/d/ over the files in bindbc-bgfx/source/bindbc/bgfx when pairing these bindings with custom versions of bgfx. If you need to regenerate the bindings, you can run genie idl in bgfx project folder, and copy the regenerated files to previously mentioned location.

  • Ari Vuollet
1.4.0+127 2024-Apr-25
1.3.2+126 2024-Mar-21
1.3.1+126 2024-Mar-12
1.3.0+126 2024-Mar-12
1.2.2+125 2024-Mar-21
Show all 34 versions
Download Stats:
  • 2 downloads today

  • 5 downloads this week

  • 5 downloads this month

  • 260 downloads total

Short URL: