Viewports: store ImGuiViewport* ParentViewport pointer as well. Backends: SDL3, Win32: use this pointer to reduce lookups. (#8948)

This commit is contained in:
ocornut
2025-09-30 18:39:34 +02:00
parent e7aa0dec5b
commit 3563f1e270
5 changed files with 27 additions and 16 deletions

View File

@@ -29,7 +29,7 @@
// Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.92.4 WIP"
#define IMGUI_VERSION_NUM 19233
#define IMGUI_VERSION_NUM 19234
#define IMGUI_HAS_TABLE // Added BeginTable() - from IMGUI_VERSION_NUM >= 18000
#define IMGUI_HAS_TEXTURES // Added ImGuiBackendFlags_RendererHasTextures - from IMGUI_VERSION_NUM >= 19198
#define IMGUI_HAS_VIEWPORT // In 'docking' WIP branch.
@@ -4044,6 +4044,7 @@ struct ImGuiViewport
ImVec2 WorkSize; // Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size)
float DpiScale; // 1.0f = 96 DPI = No extra scale.
ImGuiID ParentViewportId; // (Advanced) 0: no parent. Instruct the platform backend to setup a parent/child relationship between platform windows.
ImGuiViewport* ParentViewport; // (Advanced) == ImGui::FindViewportByID(ParentViewportId)
ImDrawData* DrawData; // The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
// Platform/Backend Dependent Data