Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump Externals/imgui from c1743ee to 3cdf3f9 #1764

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Externals/imgui
Submodule imgui updated 122 files
11 changes: 6 additions & 5 deletions src/xrEngine/Device_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
{
Expand All @@ -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{};
Expand Down
13 changes: 9 additions & 4 deletions src/xrEngine/editor_base_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "editor_helper.h"
#include "XR_IOConsole.h"

#include <imgui_internal.h>

namespace
{
bool mouse_can_use_global_state()
Expand Down Expand Up @@ -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<ImGuiBackend*>(user_data);
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIOEx(ctx);
auto& bd = *static_cast<ImGuiBackend*>(platform_io.Platform_ClipboardUserData);

if (bd.clipboard_text_data)
SDL_free(bd.clipboard_text_data);
Expand All @@ -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;

Expand Down
Loading