Commit 9f57178b authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #260

Fixed SDL_GL_SWAP_CONTROL on Windows, and the query on Linux

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401888
parent ccd4d68b
...@@ -346,7 +346,10 @@ int WIN_GL_SetupWindow(_THIS) ...@@ -346,7 +346,10 @@ int WIN_GL_SetupWindow(_THIS)
/* Uh oh, something is seriously wrong here... */ /* Uh oh, something is seriously wrong here... */
wglext = NULL; 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->wglSwapIntervalEXT = NULL;
this->gl_data->wglGetSwapIntervalEXT = NULL; this->gl_data->wglGetSwapIntervalEXT = NULL;
} }
...@@ -466,10 +469,12 @@ int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) ...@@ -466,10 +469,12 @@ int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
break; break;
case SDL_GL_SWAP_CONTROL: case SDL_GL_SWAP_CONTROL:
if ( this->gl_data->wglGetSwapIntervalEXT ) { if ( this->gl_data->wglGetSwapIntervalEXT ) {
return this->gl_data->wglGetSwapIntervalEXT(); *value = this->gl_data->wglGetSwapIntervalEXT();
return 0;
} else { } else {
return -1; return -1;
} }
break;
default: default:
return(-1); return(-1);
} }
...@@ -533,6 +538,14 @@ int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) ...@@ -533,6 +538,14 @@ int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
case SDL_GL_MULTISAMPLESAMPLES: case SDL_GL_MULTISAMPLESAMPLES:
*value = 1; *value = 1;
break; break;
case SDL_GL_SWAP_CONTROL:
if ( this->gl_data->wglGetSwapIntervalEXT ) {
*value = this->gl_data->wglGetSwapIntervalEXT();
return 0;
} else {
return -1;
}
break;
default: default:
retval = -1; retval = -1;
break; break;
......
...@@ -401,9 +401,10 @@ int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) ...@@ -401,9 +401,10 @@ int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
break; break;
case SDL_GL_SWAP_CONTROL: case SDL_GL_SWAP_CONTROL:
if ( this->gl_data->glXGetSwapIntervalMESA ) { if ( this->gl_data->glXGetSwapIntervalMESA ) {
return this->gl_data->glXGetSwapIntervalMESA(); *value = this->gl_data->glXGetSwapIntervalMESA();
return(0);
} else { } else {
return(-1)/*(this->gl_config.swap_control > 0)*/; return(-1);
} }
break; break;
default: default:
......
...@@ -834,7 +834,7 @@ int main(int argc, char *argv[]) ...@@ -834,7 +834,7 @@ int main(int argc, char *argv[])
} }
if ( strncmp(argv[i], "-h", 2) == 0 ) { if ( strncmp(argv[i], "-h", 2) == 0 ) {
printf( 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]); argv[0]);
exit(0); exit(0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment