Fixing loading not getting correctly scaled in fullscreen.

This commit is contained in:
Faerbit 2015-03-15 22:11:26 +01:00
parent 9fced79888
commit 0ae43db53e
2 changed files with 10 additions and 7 deletions

View File

@ -626,14 +626,16 @@ void Graphics::updateLights() {
void Graphics::resize(glm::uvec2 windowSize) {
this->windowSize = windowSize;
for (unsigned int i = 0; i<depth_directionalMaps.size(); i++) {
depth_directionalMaps.at(i)->resize(glm::vec2(windowSize.x, windowSize.y));
if (gameStart) {
for (unsigned int i = 0; i<depth_directionalMaps.size(); i++) {
depth_directionalMaps.at(i)->resize(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) {

View File

@ -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) {