diff --git a/engine/client/vid_common.c b/engine/client/vid_common.c index 838598cf..7f06b0c3 100644 --- a/engine/client/vid_common.c +++ b/engine/client/vid_common.c @@ -183,7 +183,7 @@ static void VID_Mode_f( void ) vidmode = R_GetVideoMode( Q_atoi( Cmd_Argv( 1 )) ); if( !vidmode ) { - Con_Printf( S_ERROR "unable to set mode, backend returned null" ); + Con_Printf( S_ERROR "unable to set mode, backend returned null\n" ); return; } diff --git a/engine/platform/sdl2/vid_sdl2.c b/engine/platform/sdl2/vid_sdl2.c index df8c4190..fc425f38 100644 --- a/engine/platform/sdl2/vid_sdl2.c +++ b/engine/platform/sdl2/vid_sdl2.c @@ -490,11 +490,18 @@ static qboolean VID_SetScreenResolution( int width, int height, window_mode_t wi return false; } - if( SDL_SetWindowFullscreen( host.hWnd, SDL_WINDOW_FULLSCREEN ) < 0 ) + if( prev_window_mode != WINDOW_MODE_FULLSCREEN ) { - Con_Printf( S_ERROR "%s: SDL_SetWindowFullscreen (fullscreen): %s\n", __func__, SDL_GetError( )); - return false; + if( SDL_SetWindowFullscreen( host.hWnd, SDL_WINDOW_FULLSCREEN ) < 0 ) + { + Con_Printf( S_ERROR "%s: SDL_SetWindowFullscreen (fullscreen): %s\n", __func__, SDL_GetError( )); + return false; + } } + + // SDL_SetWindowDisplayMode is broken in SDL2, it changes the display mode but doesn't change window size + SDL_SetWindowSize( host.hWnd, got.w, got.h ); + break; } case WINDOW_MODE_WINDOWED: