Viewports: (breaking) removed ImGuiPlatformIO::MainViewport which is now pretty much unused and duplicate (and misleading as we will evolve the concept)
// Read comments around the ImGuiPlatformIO structure for more details.
// Note: You may use GetWindowViewport() to get the current viewport of the current window.
IMGUI_APIImGuiPlatformIO&GetPlatformIO();// platform/renderer functions, for backend to setup + viewports list.
IMGUI_APIImGuiViewport*GetMainViewport();// main viewport. same as GetPlatformIO().MainViewport == GetPlatformIO().Viewports[0].
IMGUI_APIImGuiViewport*GetMainViewport();// return primary/default viewport. In the future in "no main platform window" mode we will direct this to primary monitor.
IMGUI_APIvoidUpdatePlatformWindows();// call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.
IMGUI_APIvoidRenderPlatformWindowsDefault(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_APIvoidDestroyPlatformWindows();// 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
ImVec2WorkOffsetMin;// 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!)
ImVec2WorkOffsetMax;// Work Area: Offset from Pos+Size to bottom-right corner of Work Area. Generally (0,0) or (0,-status_bar_height).
floatDpiScale;// 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().
ImGuiIDParentViewportId;// (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
boolPlatformRequestResize;// Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size)
boolPlatformRequestClose;// Platform window requested closure (e.g. window was moved by the OS / host window manager, e.g. pressing ALT-F4)