diff options
author | Andreas Grois <andi@grois.info> | 2018-03-11 13:15:09 +0100 |
---|---|---|
committer | Andreas Grois <andi@grois.info> | 2018-03-11 13:15:09 +0100 |
commit | 71689f4c1c047e6837891667f6ecfd03a9508863 (patch) | |
tree | 388b8fb2add17559ff8dbf1fa581e78d58bcbe10 | |
parent | 6842d96a7ec31d3ec192c715fee45e895ed01a48 (diff) |
Make preview window scale if being resized.
-rw-r--r-- | BuddhaTest/src/BuddhaTest.cpp | 8 |
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);
|