comparison src/video/x11/SDL_x11gl.c @ 4268:d48035d857d3 SDL-1.2

Make SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) work with GLX_SGI_swap_control. Fixes Bugzilla #697.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 29 Sep 2009 13:50:33 +0000
parents 39e748f251c6
children 91c458013850
comparison
equal deleted inserted replaced
4267:27f972dd5aff 4268:d48035d857d3
287 } 287 }
288 if ( this->gl_config.swap_control >= 0 ) { 288 if ( this->gl_config.swap_control >= 0 ) {
289 if ( this->gl_data->glXSwapIntervalMESA ) { 289 if ( this->gl_data->glXSwapIntervalMESA ) {
290 this->gl_data->glXSwapIntervalMESA(this->gl_config.swap_control); 290 this->gl_data->glXSwapIntervalMESA(this->gl_config.swap_control);
291 } else if ( this->gl_data->glXSwapIntervalSGI ) { 291 } else if ( this->gl_data->glXSwapIntervalSGI ) {
292 this->gl_data->glXSwapIntervalSGI(this->gl_config.swap_control); 292 if (this->gl_data->glXSwapIntervalSGI(this->gl_config.swap_control) != 0) {
293 this->gl_data->sgi_swap_interval = this->gl_config.swap_control;
294 }
293 } 295 }
294 } 296 }
295 #else 297 #else
296 SDL_SetError("X11 driver not configured with OpenGL"); 298 SDL_SetError("X11 driver not configured with OpenGL");
297 #endif 299 #endif
410 } 412 }
411 break; 413 break;
412 case SDL_GL_SWAP_CONTROL: 414 case SDL_GL_SWAP_CONTROL:
413 if ( this->gl_data->glXGetSwapIntervalMESA ) { 415 if ( this->gl_data->glXGetSwapIntervalMESA ) {
414 *value = this->gl_data->glXGetSwapIntervalMESA(); 416 *value = this->gl_data->glXGetSwapIntervalMESA();
415 return(0); 417 return 0;
418 } else if ( this->gl_data->glXSwapIntervalSGI ) {
419 *value = this->gl_data->sgi_swap_interval;
420 return 0;
416 } else { 421 } else {
417 unsupported = 1; 422 unsupported = 1;
418 } 423 }
419 break; 424 break;
420 default: 425 default: