ImGui::BulletText("Monitor #%d: Min (%.0f,%.0f) Max (%.0f,%.0f) Size (%.0f,%.0f)",i,mon.Pos.x,mon.Pos.y,mon.Pos.x+mon.Size.x,mon.Pos.y+mon.Size.y,mon.Size.x,mon.Size.y);
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_arg=NULL,void*renderer_arg=NULL);// Call in main loop. Will call RenderWindow/SwapBuffers platform functions for each secondary viewport. May be reimplemented by user for custom rendering needs.
IMGUI_APIvoidDestroyPlatformWindows();// (Optional) Call DestroyWindow platform functions for all viewports. Call from back-end Shutdown() if you need to close platform windows before imgui shutdown. Otherwise will be called by DestroyContext().
// (Optional) Platform/OS interface for multi-viewport support
IMGUI_APIImGuiPlatformIO&GetPlatformIO();// platform/renderer functions, for back-end to setup + viewports list.
IMGUI_APIImGuiViewport*GetMainViewport();// shortcut to == GetPlatformIO().MainViewport == GetPlatformIO().Viewports[0]
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_arg=NULL,void*renderer_arg=NULL);// call in main loop. will call RenderWindow/SwapBuffers platform functions for each secondary viewport. may be reimplemented by user for custom rendering needs.
IMGUI_APIvoidDestroyPlatformWindows();// call DestroyWindow platform functions for all viewports. call from back-end Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().
IMGUI_APIImGuiViewport*FindViewportByPlatformHandle(void*platform_handle);// this is a helper for back-ends. the type platform_handle is decided by the back-end (e.g. HWND, MyWindow*, GLFWwindow* etc.)
// Memory Utilities
// All those functions are not reliant on the current context.
@ -1875,6 +1873,14 @@ struct ImFont
// - if you are new to dear imgui and trying to integrate it into your engine, you should probably ignore this for now.
// (Optional) Represent the bounds of each connected monitor/display
// Dear ImGui only uses this to clamp the position of popups and tooltips so they don't straddle multiple monitors
structImGuiPlatformMonitor
{
ImVec2Pos;
ImVec2Size;
};
// (Optional) Setup required only if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) is enabled
// 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.
@ -1883,10 +1889,14 @@ struct ImFont
// You may skip using RenderPlatformWindowsDefault() and call your draw/swap functions yourself if you need specific behavior for your multi-window rendering.
void(*Platform_CreateWindow)(ImGuiViewport*vp);// Create a new platform window for the given viewport
void(*Platform_DestroyWindow)(ImGuiViewport*vp);
void(*Platform_ShowWindow)(ImGuiViewport*vp);// Newly created windows are initially hidden so we have a chance to call SetWindowPos/Size/Title on them.
void(*Platform_ShowWindow)(ImGuiViewport*vp);// Newly created windows are initially hidden so SetWindowPos/Size/Title can be called on them first
void(*Platform_OnChangedViewport)(ImGuiViewport*vp);// (Optional) DPI handling: Called during Begin() every time the viewport we are outputting into changes, so back-end has a chance to swap fonts to adjust style.
int(*Platform_CreateVkSurface)(ImGuiViewport*vp,ImU64vk_inst,constvoid*vk_allocators,ImU64*out_vk_surface);// (Optional) For Renderer to call into Platform code
ImGuiPlatformDataPlatformData;// This is essentially the public facing version of the Viewports vector (it is updated in UpdatePlatformWindows and exclude the viewports about to be destroyed)
ImGuiViewportP*CurrentViewport;// We track changes of viewport (happening in Begin) so we can call Platform_OnChangedViewport()