diff --git a/game/graphics.cc b/game/graphics.cc index bbd5dd3..25b1cb4 100644 --- a/game/graphics.cc +++ b/game/graphics.cc @@ -626,14 +626,16 @@ void Graphics::updateLights() { void Graphics::resize(glm::uvec2 windowSize) { this->windowSize = windowSize; - for (unsigned int i = 0; iresize(glm::vec2(windowSize.x, windowSize.y)); + if (gameStart) { + for (unsigned int i = 0; iresize(glm::vec2(windowSize.x, windowSize.y)); + } + light_fbo_color_texture->resize(windowSize); + light_fbo_depth_texture->resize(windowSize); + flamePostShader->setUniform("windowSizeX", int(windowSize.x)); + flamePostShader->setUniform("windowSizeY", int(windowSize.y)); + bindTextureUnits(); } - light_fbo_color_texture->resize(windowSize); - light_fbo_depth_texture->resize(windowSize); - flamePostShader->setUniform("windowSizeX", int(windowSize.x)); - flamePostShader->setUniform("windowSizeY", int(windowSize.y)); - bindTextureUnits(); } glm::mat4 Graphics::buildViewMatrix(Level* level) { diff --git a/game/main.cc b/game/main.cc index b432ba2..e64d2a8 100644 --- a/game/main.cc +++ b/game/main.cc @@ -122,6 +122,7 @@ bool createWindow() glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); + app.getGraphics()->resize(glm::uvec2(mode->width, mode->height)); window = glfwCreateWindow(mode->width, mode->height, "Saxum", glfwGetPrimaryMonitor(), NULL); if (!window) {