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];