Fix viewport display for high-DPI devices.

This commit is contained in:
J. de Vries
2016-04-30 11:38:05 +02:00
parent 2c04801327
commit f313234c9a
2 changed files with 6 additions and 2 deletions

View File

@@ -49,7 +49,9 @@ int main()
} }
// Define the viewport dimensions // Define the viewport dimensions
glViewport(0, 0, WIDTH, HEIGHT); int width, height;
glfwGetFramebufferSize(window, &width, &height);
glViewport(0, 0, width, height);
// Game loop // Game loop
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))

View File

@@ -53,7 +53,9 @@ int main()
glewInit(); glewInit();
// Define the viewport dimensions // Define the viewport dimensions
glViewport(0, 0, WIDTH, HEIGHT); int width, height;
glfwGetFramebufferSize(window, &width, &height);
glViewport(0, 0, width, height);
// Build and compile our shader program // Build and compile our shader program