From 7b214503608550dc2853b9e01526723f8c65baf3 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 12 May 2020 14:14:06 +0200 Subject: Added mat4 in libftm, can rotate, scale and translate vector --- src/glfw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/glfw.c') 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 +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); } -- cgit