Skip to content

Commit

Permalink
Fix #10309: [SDL] Uninitialized width and height when turning off ful…
Browse files Browse the repository at this point in the history
…l screen
  • Loading branch information
rubidium42 committed Jan 7, 2023
1 parent 29af0f8 commit 46dfb30
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/video/sdl2_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,11 @@ bool VideoDriver_SDL_Base::ChangeResolution(int w, int h)

bool VideoDriver_SDL_Base::ToggleFullscreen(bool fullscreen)
{
/* Remember current window size */
int w, h;
SDL_GetWindowSize(this->sdl_window, &w, &h);

/* Remember current window size */
if (fullscreen) {
SDL_GetWindowSize(this->sdl_window, &w, &h);

/* Find fullscreen window size */
SDL_DisplayMode dm;
if (SDL_GetCurrentDisplayMode(0, &dm) < 0) {
Expand Down

0 comments on commit 46dfb30

Please sign in to comment.