Skip to content
Permalink
Browse files

Fixed bug #260

Fixed SDL_GL_SWAP_CONTROL on Windows, and the query on Linux
  • Loading branch information
slouken committed Jun 24, 2006
1 parent 9ce0dd7 commit e9e6c15910be09d43c8467f67ffced01ee2f4859
Showing with 19 additions and 5 deletions.
  1. +15 −2 src/video/wincommon/SDL_wingl.c
  2. +3 −2 src/video/x11/SDL_x11gl.c
  3. +1 −1 test/testgl.c
@@ -346,7 +346,10 @@ int WIN_GL_SetupWindow(_THIS)
/* Uh oh, something is seriously wrong here... */
wglext = NULL;
}
if ( !wglext || !SDL_strstr(wglext, "WGL_EXT_swap_control") ) {
if ( wglext && SDL_strstr(wglext, "WGL_EXT_swap_control") ) {
this->gl_data->wglSwapIntervalEXT = WIN_GL_GetProcAddress(this, "wglSwapIntervalEXT");
this->gl_data->wglGetSwapIntervalEXT = WIN_GL_GetProcAddress(this, "wglGetSwapIntervalEXT");
} else {
this->gl_data->wglSwapIntervalEXT = NULL;
this->gl_data->wglGetSwapIntervalEXT = NULL;
}
@@ -466,10 +469,12 @@ int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
break;
case SDL_GL_SWAP_CONTROL:
if ( this->gl_data->wglGetSwapIntervalEXT ) {
return this->gl_data->wglGetSwapIntervalEXT();
*value = this->gl_data->wglGetSwapIntervalEXT();
return 0;
} else {
return -1;
}
break;
default:
return(-1);
}
@@ -533,6 +538,14 @@ int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
case SDL_GL_MULTISAMPLESAMPLES:
*value = 1;
break;
case SDL_GL_SWAP_CONTROL:
if ( this->gl_data->wglGetSwapIntervalEXT ) {
*value = this->gl_data->wglGetSwapIntervalEXT();
return 0;
} else {
return -1;
}
break;
default:
retval = -1;
break;
@@ -401,9 +401,10 @@ int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
break;
case SDL_GL_SWAP_CONTROL:
if ( this->gl_data->glXGetSwapIntervalMESA ) {
return this->gl_data->glXGetSwapIntervalMESA();
*value = this->gl_data->glXGetSwapIntervalMESA();
return(0);
} else {
return(-1)/*(this->gl_config.swap_control > 0)*/;
return(-1);
}
break;
default:
@@ -834,7 +834,7 @@ int main(int argc, char *argv[])
}
if ( strncmp(argv[i], "-h", 2) == 0 ) {
printf(
"Usage: %s [-twice] [-logo] [-logocursor] [-slow] [-bpp n] [-gamma n] [-noframe] [-fsaa] [-fullscreen]\n",
"Usage: %s [-twice] [-logo] [-logocursor] [-slow] [-bpp n] [-gamma n] [-noframe] [-fsaa] [-accel] [-sync] [-fullscreen]\n",
argv[0]);
exit(0);
}

0 comments on commit e9e6c15

Please sign in to comment.