From 005b502756bee819bdff794c6a40c57fbd21bc16 Mon Sep 17 00:00:00 2001 From: Ronald Kinard Date: Thu, 24 Jul 2014 03:15:35 -0500 Subject: [PATCH] sdl2: limit fullscreen resolution in OpenGL --- src/sdl2/i_video.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/sdl2/i_video.c b/src/sdl2/i_video.c index 43485540f..3a23d5f0d 100644 --- a/src/sdl2/i_video.c +++ b/src/sdl2/i_video.c @@ -185,14 +185,6 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) { wasfullscreen = SDL_TRUE; SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); - // Logical fullscreen is not implemented yet for OpenGL, so... - // Special case handling - if (rendermode == render_opengl) - { - int sdlw, sdlh; - SDL_GetWindowSize(window, &sdlw, &sdlh); - VID_SetMode(VID_GetModeForSize(sdlw, sdlh)); - } } else if (!fullscreen && wasfullscreen) { @@ -217,6 +209,15 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen) if (rendermode == render_opengl) { + int sdlw, sdlh; + SDL_GetWindowSize(window, &sdlw, &sdlh); + // Logical fullscreen is not implemented yet for OpenGL, so... + // Special case handling + if (USE_FULLSCREEN && width != sdlw && height != sdlh) + { + VID_SetMode(VID_GetModeForSize(sdlw, sdlh)); + return; + } OglSdlSurface(vid.width, vid.height); }