From b3509fd3dea0e281bc8df109b073d11a2df30937 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 14 Oct 2015 13:06:11 +0200 Subject: [PATCH] Fix heightmap example viewport --- examples/heightmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/heightmap.c b/examples/heightmap.c index 2742c8a2..782eef46 100644 --- a/examples/heightmap.c +++ b/examples/heightmap.c @@ -406,6 +406,7 @@ int main(int argc, char** argv) float f; GLint uloc_modelview; GLint uloc_project; + int width, height; GLuint shader_program; @@ -469,7 +470,8 @@ int main(int argc, char** argv) /* Create the vbo to store all the information for the grid and the height */ /* setup the scene ready for rendering */ - glViewport(0, 0, 800, 600); + glfwGetFramebufferSize(window, &width, &height); + glViewport(0, 0, width, height); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); /* main loop */