aboutsummaryrefslogtreecommitdiff
path: root/util/sokol_nuklear.h
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2021-02-12 18:31:21 +0100
committerAndre Weissflog <floooh@gmail.com>2021-02-12 18:31:21 +0100
commit1d0875e6e3558fea493d734438d42913db3e6fbc (patch)
treea53e1bc6c0bd33d2eb4a933cc6033385b7d61849 /util/sokol_nuklear.h
parent9d518545fcdd6e775f6fe5ff35e099bfd2c4d8fd (diff)
sokol_nuklear.h fixes
Diffstat (limited to 'util/sokol_nuklear.h')
-rw-r--r--util/sokol_nuklear.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/util/sokol_nuklear.h b/util/sokol_nuklear.h
index 1960c15b..2f7053af 100644
--- a/util/sokol_nuklear.h
+++ b/util/sokol_nuklear.h
@@ -1659,7 +1659,8 @@ SOKOL_API_IMPL void snk_setup(const snk_desc_t* desc) {
*/
/* initialize Nuklear */
- SOKOL_ASSERT(nk_init_default(&_snuklear.ctx, NULL) == 1);
+ nk_bool init_res = nk_init_default(&_snuklear.ctx, 0);
+ SOKOL_ASSERT(1 == init_res); (void)init_res; // silence unused warning in release mode
#if !defined(SOKOL_NUKLEAR_NO_SOKOL_APP)
_snuklear.ctx.clip.copy = _snk_clipboard_copy;
_snuklear.ctx.clip.paste = _snk_clipboard_paste;
@@ -2118,8 +2119,7 @@ SOKOL_API_IMPL void snk_handle_event(const sapp_event* ev) {
}
}
-SOKOL_API_IMPL nk_flags snk_edit_string(struct nk_context *ctx, nk_flags flags,
- char *memory, int *len, int max, nk_plugin_filter filter) {
+SOKOL_API_IMPL nk_flags snk_edit_string(struct nk_context *ctx, nk_flags flags, char *memory, int *len, int max, nk_plugin_filter filter) {
nk_flags event = nk_edit_string(ctx, flags, memory, len, max, filter);
if ((event & NK_EDIT_ACTIVATED) && !sapp_keyboard_shown()) {
sapp_show_keyboard(true);
@@ -2129,9 +2129,6 @@ SOKOL_API_IMPL nk_flags snk_edit_string(struct nk_context *ctx, nk_flags flags,
}
return event;
}
+#endif // SOKOL_NUKLEAR_NO_SOKOL_APP
-#endif
-
-
-
-#endif /* SOKOL_IMPL */
+#endif // SOKOL_IMPL