mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 21:39:54 +02:00
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:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user