Examples: OpenGL2: Added multi-viewport support in the OpenGL2 back-end. (#1542) + Metrics: Fix undisplayed flag.

This commit is contained in:
omar
2018-03-20 22:18:18 +01:00
parent 172570acae
commit 42ad3c1dd3
4 changed files with 48 additions and 1 deletions

View File

@ -30,6 +30,8 @@ int main(int, char**)
// Setup ImGui binding
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_EnableViewports;
io.ConfigFlags |= ImGuiConfigFlags_NoTaskBarForViewports;
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
ImGui_ImplGlfw_InitForOpenGL(window, true);
ImGui_ImplOpenGL2_Init();
@ -114,6 +116,12 @@ int main(int, char**)
glClear(GL_COLOR_BUFFER_BIT);
//glUseProgram(0); // You may want this if using this code in an OpenGL 3+ context where shaders may be bound, but prefer using the GL3+ code.
ImGui_ImplOpenGL2_RenderDrawData(ImGui::GetDrawData());
// Update and Render additional Platform Windows (when ImGuiConfigFlags_EnableViewports is enabled)
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindows(NULL, NULL);
glfwMakeContextCurrent(window);
glfwSwapBuffers(window);
}