Fixing game not getting scaled correctly in fullscreen.
This commit is contained in:
parent
a56907a956
commit
536ffc899e
@ -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) {
|
||||
|
@ -34,6 +34,7 @@ class Graphics {
|
||||
bool getRenderDebug();
|
||||
bool getRenderWorld();
|
||||
void enqueueObjects(std::vector<std::vector<Object*>>* queue);
|
||||
void saveWindowSize(glm::uvec2 windowSize);
|
||||
private:
|
||||
void bindTextureUnits();
|
||||
void updateLights();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user