Let Windows OpenGL users use SDL_GL_SWAP_CONTROL even if WGL_ARB_pixel_format SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Tue, 17 Apr 2007 08:28:19 +0000
branchSDL-1.2
changeset 39375c6e937518c6
parent 3936 c5c3c772f5aa
child 3938 345908fb5442
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
     1.1 --- a/src/video/wincommon/SDL_wingl.c	Fri Apr 06 20:30:41 2007 +0000
     1.2 +++ b/src/video/wincommon/SDL_wingl.c	Tue Apr 17 08:28:19 2007 +0000
     1.3 @@ -403,11 +403,19 @@
     1.4  	return(retval);
     1.5  }
     1.6  
     1.7 -/* Get attribute data from glX. */
     1.8 +/* Get attribute data from wgl. */
     1.9  int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
    1.10  {
    1.11  	int retval;
    1.12 -	
    1.13 +
    1.14 +	if (attrib == SDL_GL_SWAP_CONTROL) {
    1.15 +		if ( this->gl_data->wglGetSwapIntervalEXT ) {
    1.16 +			*value = this->gl_data->wglGetSwapIntervalEXT();
    1.17 +			return 0;
    1.18 +		}
    1.19 +		return -1;
    1.20 +	}
    1.21 +
    1.22  	if ( this->gl_data->WGL_ARB_pixel_format ) {
    1.23  		int wgl_attrib;
    1.24  
    1.25 @@ -466,15 +474,6 @@
    1.26  				*value = SDL_TRUE;
    1.27  			}
    1.28  			return 0;
    1.29 -			break;
    1.30 -		    case SDL_GL_SWAP_CONTROL:
    1.31 -			if ( this->gl_data->wglGetSwapIntervalEXT ) {
    1.32 -				*value = this->gl_data->wglGetSwapIntervalEXT();
    1.33 -				return 0;
    1.34 -			} else {
    1.35 -				return -1;
    1.36 -			}
    1.37 -			break;
    1.38  		    default:
    1.39  			return(-1);
    1.40  		}