This project provides D static bindings to Nuklear GUI library. Bindings were originally taken from bindbc-nuklear and stripped of dynamic loading.
The main idea is: dub add nuklear-d; dub run
. It should just work.
Add library to your project using DUB:
dub add nuklear-d
At this point, you can safely build your project. No more configurations are needed, if your goal is to get it running quickly. nuklear-d
has pre-configured flags enabled to allow for most common functionality. In case you would like to tinker, read below.
By default nuklear-d
uses the following set of flags:
"versions": [
"NK_INCLUDE_FIXED_TYPES",
"NK_INCLUDE_STANDARD_IO",
"NK_INCLUDE_STANDARD_VARARGS",
"NK_INCLUDE_DEFAULT_ALLOCATOR",
"NK_INCLUDE_VERTEX_BUFFER_OUTPUT",
"NK_INCLUDE_FONT_BAKING",
"NK_INCLUDE_DEFAULT_FONT",
"NK_KEYSTATE_BASED_INPUT"
]
Here is the full list of available flags:
NK_INCLUDE_FIXED_TYPES
NK_INCLUDE_DEFAULT_ALLOCATOR
NK_INCLUDE_STANDARD_IO
NK_INCLUDE_STANDARD_VARARGS
NK_INCLUDE_VERTEX_BUFFER_OUTPUT
NK_INCLUDE_FONT_BAKING
NK_INCLUDE_DEFAULT_FONT
NK_INCLUDE_COMMAND_USERDATA
NK_BUTTON_TRIGGER_ON_RELEASE
NK_ZERO_COMMAND_MEMORY
NK_UINT_DRAW_INDEX
To modify the configuration flags, follow these 3 steps:
git clone https://github.com/rillki/nuklear-d.git
andcd nuklear-d
- Modify
dub.{json, sdl}
configuation flags. - Modify
c/nuklear.c
configuration flags. - Delete
lib/
folder and executebuild_nuklear_static.{sh, bat}
to build the static library with your custom flags enabled. - Inside your project's
dub.{json, sdl}
find thedependencies
section and modify:
"dependencies": {
// change this
"nuklear-d": "version",
// to this
"nuklear-d": {"path": "path_to_nuklear_d"}
},
That's it.
NOTE: You can also work inside nuklear-d
. In this case, skip step 5.
This code is using the Public Domain license as suggested by Nuklear.