From 4d7387a92a3e64a7728a8f20ebfb66bcdcb58b73 Mon Sep 17 00:00:00 2001 From: svdijk Date: Sun, 21 Sep 2014 07:52:22 +0000 Subject: [PATCH] gl_vidsdl.c: Correct some swap interval related messages. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1050 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/gl_vidsdl.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/quakespasm/Quake/gl_vidsdl.c b/quakespasm/Quake/gl_vidsdl.c index 25135917..5e83d7bc 100644 --- a/quakespasm/Quake/gl_vidsdl.c +++ b/quakespasm/Quake/gl_vidsdl.c @@ -533,9 +533,6 @@ static int VID_SetMode (int width, int height, int bpp, qboolean fullscreen) if (fullscreen) flags |= SDL_FULLSCREEN; - // - // swap control (the "before SDL_SetVideoMode" part) - // gl_swap_control = true; if (SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, (vid_vsync.value) ? 1 : 0) == -1) gl_swap_control = false; @@ -884,25 +881,29 @@ static void GL_CheckExtensions (void) Con_Warning ("texture_env_add not supported\n"); } - // swap control (the "after SDL_SetVideoMode" part) + // swap control // if (!gl_swap_control) { +#if defined(USE_SDL2) + Con_Warning ("vertical sync not supported (SDL_GL_SetSwapInterval failed)\n"); +#else Con_Warning ("vertical sync not supported (SDL_GL_SetAttribute failed)\n"); +#endif } #if defined(USE_SDL2) else if ((swap_control = SDL_GL_GetSwapInterval()) == -1) - { - gl_swap_control = false; - Con_Warning ("vertical sync not supported (SDL_GL_GetSwapInterval failed)\n"); - } #else else if (SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL, &swap_control) == -1) +#endif { gl_swap_control = false; +#if defined(USE_SDL2) + Con_Warning ("vertical sync not supported (SDL_GL_GetSwapInterval failed)\n"); +#else Con_Warning ("vertical sync not supported (SDL_GL_GetAttribute failed)\n"); - } #endif + } else if ((vid_vsync.value && swap_control != 1) || (!vid_vsync.value && swap_control != 0)) { gl_swap_control = false; @@ -910,7 +911,11 @@ static void GL_CheckExtensions (void) } else { +#if defined(USE_SDL2) + Con_Printf("FOUND: SDL_GL_SetSwapInterval\n"); +#else Con_Printf("FOUND: SDL_GL_SWAP_CONTROL\n"); +#endif } // anisotropic filtering