mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 13:08:47 +02:00
Viewports: (breaking) removed ImGuiPlatformIO::MainViewport which is now pretty much unused and duplicate (and misleading as we will evolve the concept)
Use GetMainViewport() if stuck.
This commit is contained in:
7
imgui.h
7
imgui.h
@ -894,7 +894,7 @@ namespace ImGui
|
||||
// Read comments around the ImGuiPlatformIO structure for more details.
|
||||
// Note: You may use GetWindowViewport() to get the current viewport of the current window.
|
||||
IMGUI_API ImGuiPlatformIO& GetPlatformIO(); // platform/renderer functions, for backend to setup + viewports list.
|
||||
IMGUI_API ImGuiViewport* GetMainViewport(); // main viewport. same as GetPlatformIO().MainViewport == GetPlatformIO().Viewports[0].
|
||||
IMGUI_API ImGuiViewport* GetMainViewport(); // return primary/default viewport. In the future in "no main platform window" mode we will direct this to primary monitor.
|
||||
IMGUI_API void UpdatePlatformWindows(); // call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.
|
||||
IMGUI_API void RenderPlatformWindowsDefault(void* platform_render_arg = NULL, void* renderer_render_arg = NULL); // call in main loop. will call RenderWindow/SwapBuffers platform functions for each secondary viewport which doesn't have the ImGuiViewportFlags_Minimized flag set. May be reimplemented by user for custom rendering needs.
|
||||
IMGUI_API void DestroyPlatformWindows(); // call DestroyWindow platform functions for all viewports. call from backend Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().
|
||||
@ -2930,7 +2930,6 @@ struct ImGuiPlatformIO
|
||||
|
||||
// Viewports list (the list is updated by calling ImGui::EndFrame or ImGui::Render)
|
||||
// (in the future we will attempt to organize this feature to remove the need for a "main viewport")
|
||||
ImGuiViewport* MainViewport; // Guaranteed to be == Viewports[0]
|
||||
ImVector<ImGuiViewport*> Viewports; // Main viewports, followed by all secondary viewports.
|
||||
ImGuiPlatformIO() { memset(this, 0, sizeof(*this)); } // Zero clear
|
||||
};
|
||||
@ -2973,8 +2972,8 @@ struct ImGuiViewport
|
||||
ImVec2 WorkOffsetMin; // Work Area: Offset from Pos to top-left corner of Work Area. Generally (0,0) or (0,+main_menu_bar_height). Work Area is Full Area but without menu-bars/status-bars (so WorkArea always fit inside Pos/Size!)
|
||||
ImVec2 WorkOffsetMax; // Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height).
|
||||
float DpiScale; // 1.0f = 96 DPI = No extra scale.
|
||||
ImDrawData* DrawData; // The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
|
||||
ImGuiID ParentViewportId; // (Advanced) 0: no parent. Instruct the platform backend to setup a parent/child relationship between platform windows.
|
||||
ImDrawData* DrawData; // The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().
|
||||
|
||||
// Our design separate the Renderer and Platform backends to facilitate combining default backends with each others.
|
||||
// When our create your own backend for a custom engine, it is possible that both Renderer and Platform will be handled
|
||||
@ -2988,7 +2987,7 @@ struct ImGuiViewport
|
||||
bool PlatformRequestResize; // Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size)
|
||||
bool PlatformRequestClose; // Platform window requested closure (e.g. window was moved by the OS / host window manager, e.g. pressing ALT-F4)
|
||||
|
||||
ImGuiViewport() { ID = 0; Flags = 0; DpiScale = 0.0f; DrawData = NULL; ParentViewportId = 0; RendererUserData = PlatformUserData = PlatformHandle = PlatformHandleRaw = NULL; PlatformRequestMove = PlatformRequestResize = PlatformRequestClose = false; }
|
||||
ImGuiViewport() { memset(this, 0, sizeof(*this)); }
|
||||
~ImGuiViewport() { IM_ASSERT(PlatformUserData == NULL && RendererUserData == NULL); }
|
||||
|
||||
// Access work-area rectangle with GetWorkXXX functions (see comments above)
|
||||
|
Reference in New Issue
Block a user