From bdaccb98487b31d86595b66cb473f37c85fbaa8d Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 17 Apr 2007 08:28:19 +0000 Subject: [PATCH] Let Windows OpenGL users use SDL_GL_SWAP_CONTROL even if WGL_ARB_pixel_format isn't available...this looks like it got tucked into here with the other attributes, which are wrapped in a pixel_format availability check. --- src/video/wincommon/SDL_wingl.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/video/wincommon/SDL_wingl.c b/src/video/wincommon/SDL_wingl.c index 05933421c..c3ce470d8 100644 --- a/src/video/wincommon/SDL_wingl.c +++ b/src/video/wincommon/SDL_wingl.c @@ -403,11 +403,19 @@ int WIN_GL_MakeCurrent(_THIS) return(retval); } -/* Get attribute data from glX. */ +/* Get attribute data from wgl. */ int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) { int retval; - + + if (attrib == SDL_GL_SWAP_CONTROL) { + if ( this->gl_data->wglGetSwapIntervalEXT ) { + *value = this->gl_data->wglGetSwapIntervalEXT(); + return 0; + } + return -1; + } + if ( this->gl_data->WGL_ARB_pixel_format ) { int wgl_attrib; @@ -466,15 +474,6 @@ int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) *value = SDL_TRUE; } return 0; - break; - case SDL_GL_SWAP_CONTROL: - if ( this->gl_data->wglGetSwapIntervalEXT ) { - *value = this->gl_data->wglGetSwapIntervalEXT(); - return 0; - } else { - return -1; - } - break; default: return(-1); }