diff --git a/dub.json b/dub.json index 1c2d6df..1e062a5 100644 --- a/dub.json +++ b/dub.json @@ -67,7 +67,16 @@ "arsd-official:simpledisplay":"*", "arsd-official:image_files":"*", "arsd-official:svg":"*", - "arsd-official:ttf":"*" + "arsd-official:ttf":"*", + + "bindbc-freetype": { + "version": "*", + "optional": true, + }, + "bindbc-opengl": { + "version": "*", + "optional": true, + }, }, "importPaths": ["."], "libs-posix": ["freetype", "fontconfig"], diff --git a/nanovega.d b/nanovega.d index acfdd8d..a5552b0 100644 --- a/nanovega.d +++ b/nanovega.d @@ -576,9 +576,15 @@ version (bindbc) { version = nanovg_builtin_freetype_bindings; version = nanovg_builtin_opengl_bindings; // use `arsd.simpledisplay` to get basic bindings } else { + version (Have_bindbc_opengl) + version = nanovg_bindbc_opengl_bindings; + else + version = nanovg_builtin_opengl_bindings; // use `arsd.simpledisplay` to get basic bindings + version (Have_bindbc_freetype) + version = nanovg_bindbc_freetype_bindings; + else + version = nanovg_builtin_freetype_bindings; version = nanovg_builtin_fontconfig_bindings; - version = nanovg_builtin_freetype_bindings; - version = nanovg_builtin_opengl_bindings; // use `arsd.simpledisplay` to get basic bindings } version(nanovg_disable_fontconfig) {