mirror of
https://github.com/yawut/SDL.git
synced 2026-10-03 05:36:43 -05:00
Make SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) work with GLX_SGI_swap_control.
Fixes Bugzilla #697. --HG-- branch : SDL-1.2
This commit is contained in:
@@ -289,7 +289,9 @@ int X11_GL_CreateContext(_THIS)
|
||||
if ( this->gl_data->glXSwapIntervalMESA ) {
|
||||
this->gl_data->glXSwapIntervalMESA(this->gl_config.swap_control);
|
||||
} else if ( this->gl_data->glXSwapIntervalSGI ) {
|
||||
this->gl_data->glXSwapIntervalSGI(this->gl_config.swap_control);
|
||||
if (this->gl_data->glXSwapIntervalSGI(this->gl_config.swap_control) != 0) {
|
||||
this->gl_data->sgi_swap_interval = this->gl_config.swap_control;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -412,7 +414,10 @@ int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
|
||||
case SDL_GL_SWAP_CONTROL:
|
||||
if ( this->gl_data->glXGetSwapIntervalMESA ) {
|
||||
*value = this->gl_data->glXGetSwapIntervalMESA();
|
||||
return(0);
|
||||
return 0;
|
||||
} else if ( this->gl_data->glXSwapIntervalSGI ) {
|
||||
*value = this->gl_data->sgi_swap_interval;
|
||||
return 0;
|
||||
} else {
|
||||
unsupported = 1;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ struct SDL_PrivateGLData {
|
||||
GLint (*glXSwapIntervalMESA) ( unsigned interval );
|
||||
GLint (*glXGetSwapIntervalMESA) ( void );
|
||||
|
||||
int sgi_swap_interval;
|
||||
#endif /* SDL_VIDEO_OPENGL_GLX */
|
||||
};
|
||||
|
||||
|
||||
@@ -121,6 +121,8 @@ static SDL_VideoDevice *X11_CreateDevice(int devindex)
|
||||
SDL_memset(device->hidden, 0, (sizeof *device->hidden));
|
||||
SDL_memset(device->gl_data, 0, (sizeof *device->gl_data));
|
||||
|
||||
device->gl_data->sgi_swap_interval = 1;
|
||||
|
||||
/* Set the driver flags */
|
||||
device->handles_any_size = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user