aboutsummaryrefslogtreecommitdiff
path: root/BuddhaTest
diff options
context:
space:
mode:
Diffstat (limited to 'BuddhaTest')
-rw-r--r--BuddhaTest/src/BuddhaTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/BuddhaTest/src/BuddhaTest.cpp b/BuddhaTest/src/BuddhaTest.cpp
index a03e8e8..b9629bf 100644
--- a/BuddhaTest/src/BuddhaTest.cpp
+++ b/BuddhaTest/src/BuddhaTest.cpp
@@ -9,6 +9,11 @@ void error_callback(int error, const char* description)
std::cerr << "Error: " << description << std::endl;
}
+void framebuffer_size_callback(GLFWwindow* window, int width, int height)
+{
+ glViewport(0, 0, width, height);
+}
+
int main(int argc, char * argv[])
{
Helpers::RenderSettings settings;
@@ -41,6 +46,9 @@ int main(int argc, char * argv[])
return -1;
}
+ //register callback on window resize:
+ glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
+
/* Make the window's context current */
glfwMakeContextCurrent(window);
gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);