From d3c0725d86d1fdb11c9a6fa284ff7828132eb7a2 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 20 Aug 2013 10:45:03 +0200 Subject: [PATCH] implement desktopfullscreen for SDL (is this sufficient already?) --- vid_sdl.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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; } -- 2.39.2