Skip to content

Commit

Permalink
sokol_imgui.h: fix unused warning with SOKOL_IMGUI_NO_SOKOL_APP
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Oct 14, 2024
1 parent 749a591 commit 836e82e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions util/sokol_imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -2566,15 +2566,13 @@ 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();
}
#else
igCreateContext(NULL);
igStyleColorsDark(igGetStyle());
ImGuiIO* io = igGetIO();
ImGuiPlatformIO* pio = igGetPlatformIO();
if (!_simgui.desc.no_default_font) {
ImFontAtlas_AddFontDefault(io->Fonts, NULL);
}
Expand All @@ -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
Expand Down

0 comments on commit 836e82e

Please sign in to comment.