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. --HG-- branch : SDL-1.2 extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402306
This commit is contained in:
parent
0ea790c9ae
commit
b17574196b
1 changed files with 10 additions and 11 deletions
|
@ -403,11 +403,19 @@ int WIN_GL_MakeCurrent(_THIS)
|
||||||
return(retval);
|
return(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get attribute data from glX. */
|
/* Get attribute data from wgl. */
|
||||||
int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
|
int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
|
||||||
{
|
{
|
||||||
int retval;
|
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 ) {
|
if ( this->gl_data->WGL_ARB_pixel_format ) {
|
||||||
int wgl_attrib;
|
int wgl_attrib;
|
||||||
|
|
||||||
|
@ -466,15 +474,6 @@ int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
|
||||||
*value = SDL_TRUE;
|
*value = SDL_TRUE;
|
||||||
}
|
}
|
||||||
return 0;
|
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:
|
default:
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue