Examples: Viewport: Moved the "make current GL context" to reduce the amount of call and hopefully be more explicit about viewport enabled vs disabled requirements. (#1542)

This commit is contained in:
omar
2018-12-20 22:40:22 +01:00
parent d9fda22763
commit 62cfdceac1
4 changed files with 6 additions and 6 deletions

View File

@ -178,7 +178,6 @@ int main(int, char**)
// Rendering
ImGui::Render();
int display_w, display_h;
glfwMakeContextCurrent(window);
glfwGetFramebufferSize(window, &display_w, &display_h);
glViewport(0, 0, display_w, display_h);
glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);
@ -190,9 +189,9 @@ int main(int, char**)
{
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindowsDefault();
glfwMakeContextCurrent(window);
}
glfwMakeContextCurrent(window);
glfwSwapBuffers(window);
}