comparison src/video/wincommon/SDL_wingl.c @ 1737:eacc5bc01d1c

Implemented bug #5 Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 27 Apr 2006 08:39:51 +0000
parents 3b2a92126f4d
children c67921b517c3
comparison
equal deleted inserted replaced
1736:3b2a92126f4d 1737:eacc5bc01d1c
288 if ( this->gl_config.multisamplesamples ) { 288 if ( this->gl_config.multisamplesamples ) {
289 *iAttr++ = WGL_SAMPLES_ARB; 289 *iAttr++ = WGL_SAMPLES_ARB;
290 *iAttr++ = this->gl_config.multisamplesamples; 290 *iAttr++ = this->gl_config.multisamplesamples;
291 } 291 }
292 292
293 if ( this->gl_config.accelerated >= 0 ) {
294 *iAttr++ = WGL_ACCELERATION_ARB;
295 *iAttr++ = (this->gl_config.accelerated ? WGL_GENERIC_ACCELERATION_ARB : WGL_NO_ACCELERATION_ARB);
296 }
297
293 *iAttr = 0; 298 *iAttr = 0;
294 299
295 /* Choose and set the closest available pixel format */ 300 /* Choose and set the closest available pixel format */
296 if ( !this->gl_data->WGL_ARB_pixel_format || 301 if ( !this->gl_data->WGL_ARB_pixel_format ||
297 !this->gl_data->wglChoosePixelFormatARB(GL_hdc, iAttribs, fAttribs, 1, &pixel_format, &matching) || 302 !this->gl_data->wglChoosePixelFormatARB(GL_hdc, iAttribs, fAttribs, 1, &pixel_format, &matching) ||
439 case SDL_GL_MULTISAMPLEBUFFERS: 444 case SDL_GL_MULTISAMPLEBUFFERS:
440 wgl_attrib = WGL_SAMPLE_BUFFERS_ARB; 445 wgl_attrib = WGL_SAMPLE_BUFFERS_ARB;
441 break; 446 break;
442 case SDL_GL_MULTISAMPLESAMPLES: 447 case SDL_GL_MULTISAMPLESAMPLES:
443 wgl_attrib = WGL_SAMPLES_ARB; 448 wgl_attrib = WGL_SAMPLES_ARB;
449 break;
450 case SDL_GL_ACCELERATED_VISUAL:
451 wgl_attrib = WGL_ACCELERATION_ARB;
452 this->gl_data->wglGetPixelFormatAttribivARB(GL_hdc, pixel_format, 0, 1, &wgl_attrib, value);
453 if ( *value == WGL_NO_ACCELERATION_ARB ) {
454 *value = SDL_FALSE;
455 } else {
456 *value = SDL_TRUE;
457 }
458 return 0;
444 break; 459 break;
445 case SDL_GL_SWAP_CONTROL: 460 case SDL_GL_SWAP_CONTROL:
446 if ( this->gl_data->wglGetSwapIntervalEXT ) { 461 if ( this->gl_data->wglGetSwapIntervalEXT ) {
447 return this->gl_data->wglGetSwapIntervalEXT(); 462 return this->gl_data->wglGetSwapIntervalEXT();
448 } else { 463 } else {