From 136e02a692845e7738796d5b9d4011af7cf34caa Mon Sep 17 00:00:00 2001 From: k Date: Sat, 3 May 2025 19:54:30 -0400 Subject: [PATCH] fixed resize --- main.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.cc b/main.cc index 29a9a0b..35cf9eb 100644 --- a/main.cc +++ b/main.cc @@ -42,13 +42,18 @@ GLuint linkProgram(std::vector shaders) { return program; } + +void resizeCall(GLFWwindow *window, int width, int height) { + glViewport(0, 0, width, height); +} + + int main() { if (!glfwInit()) return -1; glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); - glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); GLFWwindow *w = glfwCreateWindow(800, 600, "game of life", NULL, NULL); if (!w) @@ -60,7 +65,8 @@ int main() { return -3; glfwShowWindow(w); - glViewport(0, 0, 800, 637); + glViewport(0, 0, 800, 600); + glfwSetFramebufferSizeCallback(w, resizeCall); /*gen tex*/ GLuint tex[2];