From: Rudolf Polzer Date: Tue, 20 Aug 2013 08:45:03 +0000 (+0200) Subject: implement desktopfullscreen for SDL (is this sufficient already?) X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d3c0725d86d1fdb11c9a6fa284ff7828132eb7a2;p=xonotic%2Fdarkplaces.git implement desktopfullscreen for SDL (is this sufficient already?) --- diff --git a/vid_sdl.c b/vid_sdl.c index 3211eaa1..6d200f22 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -1132,11 +1132,12 @@ void Sys_SendKeyEvents( void ) case SDL_VIDEOEXPOSE: break; case SDL_VIDEORESIZE: - if(vid_resizable.integer < 2) + if(vid_resizable.integer < 2 || vid_isfullscreen) { vid.width = event.resize.w; vid.height = event.resize.h; - screen = SDL_SetVideoMode(vid.width, vid.height, video_bpp, video_flags); + if (!vid_isfullscreen) + screen = SDL_SetVideoMode(vid.width, vid.height, video_bpp, video_flags); if (vid_softsurface) { SDL_FreeSurface(vid_softsurface); @@ -2477,7 +2478,10 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode) #if SDL_MAJOR_VERSION == 1 flags |= SDL_FULLSCREEN; #else - windowflags |= SDL_WINDOW_FULLSCREEN; + if (vid_desktopfullscreen.integer) + windowflags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + else + windowflags |= SDL_WINDOW_FULLSCREEN; #endif vid_isfullscreen = true; } @@ -2621,7 +2625,10 @@ static qboolean VID_InitModeSoft(viddef_mode_t *mode) #if SDL_MAJOR_VERSION == 1 flags |= SDL_FULLSCREEN; #else - windowflags |= SDL_WINDOW_FULLSCREEN; + if (vid_desktopfullscreen.integer) + windowflags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + else + windowflags |= SDL_WINDOW_FULLSCREEN; #endif vid_isfullscreen = true; }