mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-12 11:33:22 +08:00
Fix viewport display for high-DPI devices.
This commit is contained in:
@@ -49,7 +49,9 @@ int main()
|
||||
}
|
||||
|
||||
// Define the viewport dimensions
|
||||
glViewport(0, 0, WIDTH, HEIGHT);
|
||||
int width, height;
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
// Game loop
|
||||
while (!glfwWindowShouldClose(window))
|
||||
|
||||
@@ -53,7 +53,9 @@ int main()
|
||||
glewInit();
|
||||
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user