aboutsummaryrefslogtreecommitdiff
path: root/util/sokol_nuklear.h
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2021-04-06 18:39:32 +0200
committerAndre Weissflog <floooh@gmail.com>2021-04-06 18:39:32 +0200
commite1058e11ec1dfb799740bf822fb91274adadd16c (patch)
treecb3ccef302a548338a70623b42b3bddc22a3bf04 /util/sokol_nuklear.h
parent8a01f6e498bd6364c352f0b45dbc9e3de1d48ded (diff)
sokol_nuklear.h, sokol_imgui.h: cleanup no-sokol-app vs dummy-backend confusion
Diffstat (limited to 'util/sokol_nuklear.h')
-rw-r--r--util/sokol_nuklear.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/util/sokol_nuklear.h b/util/sokol_nuklear.h
index b989941e..41a6bdc4 100644
--- a/util/sokol_nuklear.h
+++ b/util/sokol_nuklear.h
@@ -258,7 +258,7 @@ inline void snk_setup(const snk_desc_t& desc) { return snk_setup(&desc); }
#include <stddef.h> /* offsetof */
#include <string.h> /* memset */
-#if !defined(SOKOL_NUKLEAR_NO_SOKOL_APP) && defined(__EMSCRIPTEN__)
+#if defined(__EMSCRIPTEN__) && !defined(SOKOL_NUKLEAR_NO_SOKOL_APP) && !defined(SOKOL_DUMMY_BACKEND)
#include <emscripten.h>
#endif
@@ -1633,7 +1633,7 @@ static void _snk_clipboard_paste(nk_handle usr, struct nk_text_edit *edit) {
(void)usr;
}
-#if defined(__EMSCRIPTEN__)
+#if defined(__EMSCRIPTEN__) && !defined(SOKOL_DUMMY_BACKEND)
EM_JS(int, snk_js_is_osx, (void), {
if (navigator.userAgent.includes('Macintosh')) {
return 1;
@@ -1645,12 +1645,14 @@ EM_JS(int, snk_js_is_osx, (void), {
#endif
static bool _snk_is_osx(void) {
- #if defined(__EMSCRIPTEN__)
- return snk_js_is_osx();
+ #if defined(SOKOL_DUMMY_BACKEND)
+ return false;
+ #elif defined(__EMSCRIPTEN__)
+ return snk_js_is_osx();
#elif defined(__APPLE__)
- return true;
+ return true;
#else
- return false;
+ return false;
#endif
}
#endif // !SOKOL_NUKLEAR_NO_SOKOL_APP