From 6815db255a48c389f97e4500d2aa801d416f4d21 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Thu, 1 Jun 2023 12:44:56 -0400 Subject: [PATCH] let dub use the optional bindbc based bindings if user opts in (WARNING UNTESTED) --- dub.json | 11 ++++++++++- nanovega.d | 10 ++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) 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) {