Examples: OpenGL: fix for retina screens + io.DisplayFramebufferScale storage (#287)

This commit is contained in:
ocornut
2015-08-27 19:51:02 +01:00
parent a36001212f
commit e58f99179a
6 changed files with 31 additions and 22 deletions

View File

@ -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();