diff --git a/Externals/imgui b/Externals/imgui index c1743eef484..3cdf3f9411b 160000 --- a/Externals/imgui +++ b/Externals/imgui @@ -1 +1 @@ -Subproject commit c1743eef48432a08438de0926a6fc657e5ce2d11 +Subproject commit 3cdf3f9411b20cc877bab399279c9bc450185efb diff --git a/src/xrEngine/Device_imgui.cpp b/src/xrEngine/Device_imgui.cpp index e7f4d8dd490..63e90de21c1 100644 --- a/src/xrEngine/Device_imgui.cpp +++ b/src/xrEngine/Device_imgui.cpp @@ -27,9 +27,10 @@ void CRenderDevice::InitializeImGui() io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard | ImGuiConfigFlags_NavEnableGamepad | - ImGuiConfigFlags_NavEnableSetMousePos | ImGuiConfigFlags_DockingEnable; + io.ConfigNavMoveSetMousePos = true; + string_path fName; FS.update_path(fName, "$app_data_root$", io.IniFilename); convert_path_separators(fName); @@ -40,7 +41,10 @@ void CRenderDevice::InitializeImGui() io.BackendPlatformName = "OpenXRay"; - io.SetPlatformImeDataFn = [](ImGuiViewport* viewport, ImGuiPlatformImeData* data) + // Register platform interface (will be coupled with a renderer interface) + ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO(); + + platform_io.Platform_SetImeDataFn = [](ImGuiContext* ctx, ImGuiViewport* viewport, ImGuiPlatformImeData* data) { if (data->WantVisible) { @@ -56,9 +60,6 @@ void CRenderDevice::InitializeImGui() }; #ifdef IMGUI_ENABLE_VIEWPORTS - // Register platform interface (will be coupled with a renderer interface) - ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO(); - platform_io.Platform_CreateWindow = [](ImGuiViewport* viewport) { Uint32 sdl_flags{}; diff --git a/src/xrEngine/editor_base_input.cpp b/src/xrEngine/editor_base_input.cpp index e796aedcb5b..20990ac187f 100644 --- a/src/xrEngine/editor_base_input.cpp +++ b/src/xrEngine/editor_base_input.cpp @@ -4,6 +4,8 @@ #include "editor_helper.h" #include "XR_IOConsole.h" +#include + namespace { bool mouse_can_use_global_state() @@ -45,14 +47,17 @@ void ide::InitBackend() #endif } + ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO(); + // Clipboard functionality - io.SetClipboardTextFn = [](void*, const char* text) + platform_io.Platform_SetClipboardTextFn = [](ImGuiContext*, const char* text) { SDL_SetClipboardText(text); }; - io.GetClipboardTextFn = [](void* user_data) -> const char* + platform_io.Platform_GetClipboardTextFn = [](ImGuiContext* ctx) -> const char* { - auto& bd = *static_cast(user_data); + ImGuiPlatformIO& platform_io = ImGui::GetPlatformIOEx(ctx); + auto& bd = *static_cast(platform_io.Platform_ClipboardUserData); if (bd.clipboard_text_data) SDL_free(bd.clipboard_text_data); @@ -61,7 +66,7 @@ void ide::InitBackend() return bd.clipboard_text_data; }; - io.ClipboardUserData = &m_imgui_backend; + platform_io.Platform_ClipboardUserData = &m_imgui_backend; auto& bd = m_imgui_backend;