mirror of https://github.com/OpenTTD/OpenTTD
Fix #10309: [SDL] Uninitialized width and height when turning off full screen
parent
29af0f8c7b
commit
46dfb309bc
|
@ -648,12 +648,11 @@ bool VideoDriver_SDL_Base::ChangeResolution(int w, int h)
|
||||||
|
|
||||||
bool VideoDriver_SDL_Base::ToggleFullscreen(bool fullscreen)
|
bool VideoDriver_SDL_Base::ToggleFullscreen(bool fullscreen)
|
||||||
{
|
{
|
||||||
int w, h;
|
|
||||||
|
|
||||||
/* Remember current window size */
|
/* Remember current window size */
|
||||||
if (fullscreen) {
|
int w, h;
|
||||||
SDL_GetWindowSize(this->sdl_window, &w, &h);
|
SDL_GetWindowSize(this->sdl_window, &w, &h);
|
||||||
|
|
||||||
|
if (fullscreen) {
|
||||||
/* Find fullscreen window size */
|
/* Find fullscreen window size */
|
||||||
SDL_DisplayMode dm;
|
SDL_DisplayMode dm;
|
||||||
if (SDL_GetCurrentDisplayMode(0, &dm) < 0) {
|
if (SDL_GetCurrentDisplayMode(0, &dm) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue