mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-12 15:59:54 +02:00
Examples: OpenGL: fix for retina screens + io.DisplayFramebufferScale storage (#287)
This commit is contained in:
@ -53,7 +53,6 @@ int main(int, char**)
|
||||
// Main loop
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
glfwPollEvents();
|
||||
ImGui_ImplGlfwGL3_NewFrame();
|
||||
|
||||
@ -86,7 +85,9 @@ int main(int, char**)
|
||||
}
|
||||
|
||||
// Rendering
|
||||
glViewport(0, 0, (int)io.DisplaySize.x, (int)io.DisplaySize.y);
|
||||
int display_w, display_h;
|
||||
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);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
ImGui::Render();
|
||||
|
Reference in New Issue
Block a user