From b5c028c64b5ef870fd1c827f8a86cf7ed0d7a512 Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 5 Jul 2023 14:55:22 +0200 Subject: [PATCH] Enable Mulit-viewports --- Getting-Started.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Getting-Started.md b/Getting-Started.md index 78a5b50..b9a80e8 100644 --- a/Getting-Started.md +++ b/Getting-Started.md @@ -10,6 +10,7 @@ - [Example: If you are using SDL2 + OpenGL/WebGL](#example-if-you-are-using-sdl2--openglwebgl) - [Example: If you are using SDL2 + Vulkan](#example-if-you-are-using-sdl2--vulkan) - [Using another combination of backends?](#using-another-combination-of-backends) +- [Additional code to enable Multi-viewports mode](#additional-code-to-enable-multi-viewports-mode) ## Preamble @@ -408,4 +409,17 @@ That should be all! ## Using another combination of backends? The various examples above should reflect integration with a majority of backends, so you can follow the same logic. -Some backends require more information from you (e.g. in particular Vulkan and DirectX12 rendering backends). When in doubt, refer to the corresponding [examples](https://github.com/ocornut/imgui/tree/master/examples) application. \ No newline at end of file +Some backends require more information from you (e.g. in particular Vulkan and DirectX12 rendering backends). When in doubt, refer to the corresponding [examples](https://github.com/ocornut/imgui/tree/master/examples) application. + +## Additional code to enable Multi-viewports mode + +To use the [Multi-viewports](https://github.com/ocornut/imgui/wiki/Multi-Viewports) feature, pull the `docking` branch and enable the configuration flag: +```cpp +io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; +``` +At the end of your render loop, generally after rendering your main viewport but before presenting/swapping it: +```cpp +// Update and Render additional Platform Windows +ImGui::UpdatePlatformWindows(); +ImGui::RenderPlatformWindowsDefault(); +```