From a35843418df399a16c2861262b7ebea98fc2f2b5 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 14 May 2024 14:51:57 +0200 Subject: [PATCH] Updated Getting Started (markdown) --- Getting-Started.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Getting-Started.md b/Getting-Started.md index 86f5a24..de5db16 100644 --- a/Getting-Started.md +++ b/Getting-Started.md @@ -448,12 +448,17 @@ 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(); +if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) +{ + // Update and Render additional Platform Windows + ImGui::UpdatePlatformWindows(); + ImGui::RenderPlatformWindowsDefault(); + + // TODO for OpenGL: restore current GL context. +} ``` -Note that there may be additional calls required surrounding this depending on the backend you are using (OpenGL in particular). Check the [example project](https://github.com/ocornut/imgui/tree/docking/examples) appropriate to your setup for details. +Note that there may be additional calls required surrounding this depending on the backend you are using (**OpenGL in particular needs backup/restore of current GL context**). Check the [example project](https://github.com/ocornut/imgui/tree/docking/examples) appropriate to your setup for details. ## Once you are setup...