From 836e82e648635be2a3d7721bb9c9accbcae665e5 Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Fri, 20 Sep 2024 17:46:29 +0200 Subject: [PATCH] sokol_imgui.h: fix unused warning with SOKOL_IMGUI_NO_SOKOL_APP --- util/sokol_imgui.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h index 6daec37f6..051d993db 100644 --- a/util/sokol_imgui.h +++ b/util/sokol_imgui.h @@ -2566,7 +2566,6 @@ SOKOL_API_IMPL void simgui_setup(const simgui_desc_t* desc) { ImGui::CreateContext(); ImGui::StyleColorsDark(); ImGuiIO* io = &ImGui::GetIO(); - ImGuiPlatformIO* pio = &ImGui::GetPlatformIO(); if (!_simgui.desc.no_default_font) { io->Fonts->AddFontDefault(); } @@ -2574,7 +2573,6 @@ SOKOL_API_IMPL void simgui_setup(const simgui_desc_t* desc) { igCreateContext(NULL); igStyleColorsDark(igGetStyle()); ImGuiIO* io = igGetIO(); - ImGuiPlatformIO* pio = igGetPlatformIO(); if (!_simgui.desc.no_default_font) { ImFontAtlas_AddFontDefault(io->Fonts, NULL); } @@ -2586,6 +2584,11 @@ SOKOL_API_IMPL void simgui_setup(const simgui_desc_t* desc) { if (!_simgui.desc.disable_set_mouse_cursor) { io->BackendFlags |= ImGuiBackendFlags_HasMouseCursors; } + #if defined(__cplusplus) + ImGuiPlatformIO* pio = &ImGui::GetPlatformIO(); + #else + ImGuiPlatformIO* pio = igGetPlatformIO(); + #endif pio->Platform_SetClipboardTextFn = _simgui_set_clipboard; pio->Platform_GetClipboardTextFn = _simgui_get_clipboard; #endif