diff options
| author | Andre Weissflog <floooh@gmail.com> | 2020-02-02 17:21:59 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2020-02-02 17:21:59 +0100 |
| commit | 196aa649f15a7ef05af64fedf5c90f64dc6d2fdd (patch) | |
| tree | a8597f51f0ecd185a31d3e6ea80803a45369133f | |
| parent | d8454bf1f6d1066758ed088f63a342c8ac4e75d4 (diff) | |
sokol_imgui.h: fix compilation with SOKOL_IMGUI_NO_SOKOL_APP
| -rw-r--r-- | util/sokol_imgui.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h index ccd1345d..f26a8790 100644 --- a/util/sokol_imgui.h +++ b/util/sokol_imgui.h @@ -292,12 +292,12 @@ typedef struct { sg_image img; sg_shader shd; sg_pipeline pip; + bool is_osx; // return true if running on OSX (or HTML5 OSX), needed for copy/paste #if !defined(SOKOL_IMGUI_NO_SOKOL_APP) bool btn_down[SAPP_MAX_MOUSEBUTTONS]; bool btn_up[SAPP_MAX_MOUSEBUTTONS]; uint8_t keys_down[SIMGUI_MAX_KEY_VALUE]; // bits 0..3 or modifiers, != 0 is key-down uint8_t keys_up[SIMGUI_MAX_KEY_VALUE]; // same is keys_down - bool is_osx; // return true if running on OSX (or HTML5 OSX), needed for copy/paste #endif } _simgui_state_t; static _simgui_state_t _simgui; @@ -721,6 +721,7 @@ static const char* _simgui_get_clipboard(void* user_data) { (void)user_data; return sapp_get_clipboard_string(); } +#endif #if defined(__EMSCRIPTEN__) EM_JS(int, simgui_js_is_osx, (void), { @@ -742,7 +743,6 @@ static bool _simgui_is_osx(void) { return false; #endif } -#endif SOKOL_API_IMPL void simgui_setup(const simgui_desc_t* desc) { SOKOL_ASSERT(desc); @@ -925,12 +925,14 @@ SOKOL_API_IMPL void simgui_shutdown(void) { sg_destroy_buffer(_simgui.vbuf); } +#if !defined(SOKOL_IMGUI_NO_SOKOL_APP) _SOKOL_PRIVATE void _simgui_set_imgui_modifiers(ImGuiIO* io, uint32_t mods) { io->KeyAlt = (mods & SAPP_MODIFIER_ALT) != 0; io->KeyCtrl = (mods & SAPP_MODIFIER_CTRL) != 0; io->KeyShift = (mods & SAPP_MODIFIER_SHIFT) != 0; io->KeySuper = (mods & SAPP_MODIFIER_SUPER) != 0; } +#endif SOKOL_API_IMPL void simgui_new_frame(int width, int height, double delta_time) { #if defined(__cplusplus) |