Skip to content

Commit

Permalink
Let Windows OpenGL users use SDL_GL_SWAP_CONTROL even if WGL_ARB_pixe…
Browse files Browse the repository at this point in the history
…l_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.
  • Loading branch information
icculus committed Apr 17, 2007
1 parent 5d95117 commit bdaccb9
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/video/wincommon/SDL_wingl.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit bdaccb9

Please sign in to comment.