diff --git a/quakespasm/Quake/gl_vidsdl.c b/quakespasm/Quake/gl_vidsdl.c index 8afba7bf..087bff7f 100644 --- a/quakespasm/Quake/gl_vidsdl.c +++ b/quakespasm/Quake/gl_vidsdl.c @@ -203,6 +203,11 @@ static qboolean VID_ValidMode (int width, int height, int bpp, qboolean fullscre if (height < 200) return false; + if (fullscreen) + flags |= SDL_FULLSCREEN; + + bpp = SDL_VideoModeOK(width, height, bpp, flags); + switch (bpp) { case 16: @@ -213,12 +218,6 @@ static qboolean VID_ValidMode (int width, int height, int bpp, qboolean fullscre return false; } - if (fullscreen) - flags |= SDL_FULLSCREEN; - - if (!SDL_VideoModeOK(width, height, bpp, flags)) - return false; - return true; } @@ -250,6 +249,8 @@ static int VID_SetMode (int width, int height, int bpp, qboolean fullscreen) if (SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, (vid_vsync.value) ? 1 : 0) == -1) gl_swap_control = false; + bpp = SDL_VideoModeOK(width, height, bpp, flags); + draw_context = SDL_SetVideoMode(width, height, bpp, flags); if (!draw_context) Sys_Error ("Couldn't set video mode");