aboutsummaryrefslogtreecommitdiff
path: root/src/glfw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glfw.c')
-rw-r--r--src/glfw.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/glfw.c b/src/glfw.c
index a492c08..1071ae0 100644
--- a/src/glfw.c
+++ b/src/glfw.c
@@ -6,12 +6,18 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/05/11 01:58:00 by charles #+# #+# */
-/* Updated: 2020/05/11 09:41:51 by charles ### ########.fr */
+/* Updated: 2020/05/12 13:58:51 by charles ### ########.fr */
/* */
/* ************************************************************************** */
#include "scop.h"
+void st_resize_callback(GLFWwindow *window, int width, int height)
+{
+ (void)window;
+ glViewport(0, 0, width, height);
+}
+
GLFWwindow *glfw_init(int width, int height)
{
GLFWwindow *window;
@@ -28,6 +34,7 @@ GLFWwindow *glfw_init(int width, int height)
return (NULL);
}
glfwMakeContextCurrent(window);
+ glfwSetFramebufferSizeCallback(window, st_resize_callback);
if (glewInit() != GLEW_OK)
{
glfwDestroyWindow(window);
@@ -35,6 +42,6 @@ GLFWwindow *glfw_init(int width, int height)
return (NULL);
}
glfwSwapInterval(1);
- glViewport(0, 0, width, height);
+ /* glViewport(0, 0, width, height); */
return (window);
}