Skip to content

Commit

Permalink
Fix video mode and geometry update for SDL 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet committed Nov 2, 2013
1 parent 384d2be commit 98888c2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/unix/sdl2/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ static void VID_SDL_SetMode(void)
int freq;

if (vid_fullscreen->integer) {
// FIXME: force update by toggling fullscreen mode
SDL_SetWindowFullscreen(sdl_window, 0);

if (VID_GetFullscreen(&rc, &freq, NULL)) {
SDL_DisplayMode mode = {
.format = SDL_PIXELFORMAT_UNKNOWN,
Expand All @@ -221,6 +224,10 @@ static void VID_SDL_SetMode(void)
flags = SDL_WINDOW_FULLSCREEN_DESKTOP;
}
} else {
if (VID_GetGeometry(&rc)) {
SDL_SetWindowSize(sdl_window, rc.width, rc.height);
SDL_SetWindowPosition(sdl_window, rc.x, rc.y);
}
flags = 0;
}

Expand Down

0 comments on commit 98888c2

Please sign in to comment.