comparison src/video/wincommon/SDL_wingl.c @ 3937:5c6e937518c6 SDL-1.2

Let Windows OpenGL users use SDL_GL_SWAP_CONTROL even if WGL_ARB_pixel_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.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 17 Apr 2007 08:28:19 +0000
parents 9d940db55a91
children f9d0b64cc7b9
comparison
equal deleted inserted replaced
3936:c5c3c772f5aa 3937:5c6e937518c6
401 retval = -1; 401 retval = -1;
402 } 402 }
403 return(retval); 403 return(retval);
404 } 404 }
405 405
406 /* Get attribute data from glX. */ 406 /* Get attribute data from wgl. */
407 int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) 407 int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
408 { 408 {
409 int retval; 409 int retval;
410 410
411 if (attrib == SDL_GL_SWAP_CONTROL) {
412 if ( this->gl_data->wglGetSwapIntervalEXT ) {
413 *value = this->gl_data->wglGetSwapIntervalEXT();
414 return 0;
415 }
416 return -1;
417 }
418
411 if ( this->gl_data->WGL_ARB_pixel_format ) { 419 if ( this->gl_data->WGL_ARB_pixel_format ) {
412 int wgl_attrib; 420 int wgl_attrib;
413 421
414 switch(attrib) { 422 switch(attrib) {
415 case SDL_GL_RED_SIZE: 423 case SDL_GL_RED_SIZE:
464 *value = SDL_FALSE; 472 *value = SDL_FALSE;
465 } else { 473 } else {
466 *value = SDL_TRUE; 474 *value = SDL_TRUE;
467 } 475 }
468 return 0; 476 return 0;
469 break;
470 case SDL_GL_SWAP_CONTROL:
471 if ( this->gl_data->wglGetSwapIntervalEXT ) {
472 *value = this->gl_data->wglGetSwapIntervalEXT();
473 return 0;
474 } else {
475 return -1;
476 }
477 break;
478 default: 477 default:
479 return(-1); 478 return(-1);
480 } 479 }
481 this->gl_data->wglGetPixelFormatAttribivARB(GL_hdc, pixel_format, 0, 1, &wgl_attrib, value); 480 this->gl_data->wglGetPixelFormatAttribivARB(GL_hdc, pixel_format, 0, 1, &wgl_attrib, value);
482 481