mirror of
https://github.com/love2d/love.git
synced 2026-08-20 20:49:54 +02:00
Make setMode get the actual width and height after setting, fixes bug with width and height 0 (aka desktop resolution)
This commit is contained in:
@@ -113,7 +113,11 @@ namespace opengl
|
|||||||
// the display mode change.
|
// the display mode change.
|
||||||
Volatile::unloadAll();
|
Volatile::unloadAll();
|
||||||
|
|
||||||
currentWindow->setWindow(width, height, fullscreen, vsync, fsaa);
|
bool success = currentWindow->setWindow(width, height, fullscreen, vsync, fsaa);
|
||||||
|
// Regardless of failure, we'll have to set up OpenGL once again.
|
||||||
|
|
||||||
|
width = currentWindow->getWidth();
|
||||||
|
height = currentWindow->getHeight();
|
||||||
|
|
||||||
// Okay, setup OpenGL.
|
// Okay, setup OpenGL.
|
||||||
|
|
||||||
@@ -160,7 +164,7 @@ namespace opengl
|
|||||||
glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &matrixLimit);
|
glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &matrixLimit);
|
||||||
matrixLimit -= 5;
|
matrixLimit -= 5;
|
||||||
|
|
||||||
return true;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphics::getMode(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa)
|
void Graphics::getMode(int &width, int &height, bool &fullscreen, bool &vsync, int &fsaa)
|
||||||
|
|||||||
Reference in New Issue
Block a user