diff --git a/game/graphics.cc b/game/graphics.cc index 5c55c92..8113f73 100644 --- a/game/graphics.cc +++ b/game/graphics.cc @@ -627,6 +627,10 @@ void Graphics::updateLights() { glUniform1iv(lightingShader->getUniformLocation("isFlame"), sizeof(isFlame), (GLint*) isFlame); } +void Graphics::saveWindowSize(glm::uvec2 windowSize) { + this->windowSize = windowSize; +} + void Graphics::resize(glm::uvec2 windowSize) { this->windowSize = windowSize; if (gameStart) { diff --git a/game/graphics.hh b/game/graphics.hh index 3808657..0560e27 100644 --- a/game/graphics.hh +++ b/game/graphics.hh @@ -34,6 +34,7 @@ class Graphics { bool getRenderDebug(); bool getRenderWorld(); void enqueueObjects(std::vector>* queue); + void saveWindowSize(glm::uvec2 windowSize); private: void bindTextureUnits(); void updateLights(); diff --git a/game/main.cc b/game/main.cc index 105bc69..d66cece 100644 --- a/game/main.cc +++ b/game/main.cc @@ -125,6 +125,7 @@ bool createWindow() glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); + app.getGraphics()->saveWindowSize(glm::uvec2(mode->width, mode->height)); window = glfwCreateWindow(mode->width, mode->height, "Saxum", glfwGetPrimaryMonitor(), NULL); if (!window) { @@ -168,8 +169,9 @@ int main( int argc, char *argv[] ) // Enable vertical sync (on cards that support it) with parameter 1 - 0 means off glfwSwapInterval( 0 ); - + app.init(); + app.getGraphics()->resize(app.getGraphics()->getWindowSize()); glBindFramebuffer( GL_FRAMEBUFFER, 0 ); glfwSwapBuffers(window); app.initLevel();