diff --git a/src/1.getting_started/1.hello_window/hellowindow2.cpp b/src/1.getting_started/1.hello_window/hellowindow2.cpp index 04d3890..67eaaaa 100644 --- a/src/1.getting_started/1.hello_window/hellowindow2.cpp +++ b/src/1.getting_started/1.hello_window/hellowindow2.cpp @@ -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)) diff --git a/src/1.getting_started/2.hello_triangle/hellotriangle2.cpp b/src/1.getting_started/2.hello_triangle/hellotriangle2.cpp index cbbf95e..6bf2e90 100644 --- a/src/1.getting_started/2.hello_triangle/hellotriangle2.cpp +++ b/src/1.getting_started/2.hello_triangle/hellotriangle2.cpp @@ -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