# HG changeset patch # User Ryan C. Gordon # Date 1176798499 0 # Node ID 5c6e937518c68e158d579d49b739ee2fd9b1f94b # Parent c5c3c772f5aa1f159d313d6003060e706e4f8254 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. diff -r c5c3c772f5aa -r 5c6e937518c6 src/video/wincommon/SDL_wingl.c --- a/src/video/wincommon/SDL_wingl.c Fri Apr 06 20:30:41 2007 +0000 +++ b/src/video/wincommon/SDL_wingl.c Tue Apr 17 08:28:19 2007 +0000 @@ -403,11 +403,19 @@ 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 @@ *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); }