// (Optional) Setup required only if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) is enabled. Access via ImGui::GetPlatformIO().
// This is designed so we can mix and match two imgui_impl_xxxx files, one for the Platform (~window handling), one for Renderer.
// Custom engine back-ends will often provide both Platform and Renderer interfaces and thus may not need to use all functions.
// Platform functions are typically called before their Renderer counterpart, apart from Destroy which are called the other way.
// RenderPlatformWindowsDefault() basically iterate secondary viewports and call Platform+Renderer's RenderWindow then Platform+Renderer's SwapBuffers,
// You may skip using RenderPlatformWindowsDefault() and call your draw/swap functions yourself if you need specific behavior for your multi-window rendering.
// (Optional) Setup required only if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) is enabled.
// Access via ImGui::GetPlatformIO(). This is designed so we can mix and match two imgui_impl_xxxx files, one for
// the Platform (~window handling), one for Renderer. Custom engine back-ends will often provide both Platform
// and Renderer interfaces and thus may not need to use all functions.
// Platform functions are typically called before their Renderer counterpart,
// apart from Destroy which are called the other way.
// RenderPlatformWindowsDefault() is that helper that iterate secondary viewports and call, in this order:
// List of viewports (the list is updated by calling ImGui::EndFrame or ImGui::Render)
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
};
// Flags stored in ImGuiViewport::Flags, giving indications to the platform back-ends
// Flags stored in ImGuiViewport::Flags, giving indications to the platform back-ends.
enumImGuiViewportFlags_
{
ImGuiViewportFlags_None=0,
@ -2150,7 +2154,7 @@ struct ImGuiViewport
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().
void*PlatformUserData;// void* to hold custom data structure for the platform (e.g. windowing info, render context)
void*PlatformUserData;// void* to hold custom data structure for the OS / platform (e.g. windowing info, render context)
void*PlatformHandle;// void* for FindViewportByPlatformHandle(). (e.g. suggested to use natural platform handle such as HWND, GlfwWindow*, SDL_Window*)
boolPlatformRequestClose;// Platform window requested closure (e.g. window was moved by the OS / host window manager, e.g. pressing ALT-F4)
boolPlatformRequestMove;// Platform window requested move (e.g. window was moved by the OS / host window manager, authoritative position will be OS window position)