Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GH Action committed Sep 10, 2024
1 parent 455c00b commit 1d45a89
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/sokol/c/sokol_imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -1844,13 +1844,13 @@ static const char* _simgui_fs_source_dummy = "";
#endif

#if !defined(SOKOL_IMGUI_NO_SOKOL_APP)
static void _simgui_set_clipboard(void* user_data, const char* text) {
(void)user_data;
static void _simgui_set_clipboard(ImGuiContext* ctx, const char* text) {
(void)ctx;
sapp_set_clipboard_string(text);
}

static const char* _simgui_get_clipboard(void* user_data) {
(void)user_data;
static const char* _simgui_get_clipboard(ImGuiContext* ctx) {
(void)ctx;
return sapp_get_clipboard_string();
}
#endif
Expand Down Expand Up @@ -2200,13 +2200,15 @@ 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 @@ -2218,8 +2220,8 @@ SOKOL_API_IMPL void simgui_setup(const simgui_desc_t* desc) {
if (!_simgui.desc.disable_set_mouse_cursor) {
io->BackendFlags |= ImGuiBackendFlags_HasMouseCursors;
}
io->SetClipboardTextFn = _simgui_set_clipboard;
io->GetClipboardTextFn = _simgui_get_clipboard;
pio->Platform_SetClipboardTextFn = _simgui_set_clipboard;
pio->Platform_GetClipboardTextFn = _simgui_get_clipboard;
#endif
io->ConfigWindowsResizeFromEdges = !_simgui.desc.disable_windows_resize_from_edges;

Expand Down

0 comments on commit 1d45a89

Please sign in to comment.