comparison src/video/wincommon/SDL_wingl.c @ 1659:14717b52abc0 SDL-1.3

Merge trunk-1.3-3
author Sam Lantinga <slouken@libsdl.org>
date Wed, 17 May 2006 08:18:28 +0000
parents 96c2f89cc7e1
children 782fd950bd46
comparison
equal deleted inserted replaced
1658:e49147870aac 1659:14717b52abc0
175 int i; 175 int i;
176 unsigned int matching; 176 unsigned int matching;
177 int iAttribs[64]; 177 int iAttribs[64];
178 int *iAttr; 178 int *iAttr;
179 float fAttribs[1] = { 0 }; 179 float fAttribs[1] = { 0 };
180 const GLubyte *(WINAPI *glGetStringFunc)(GLenum);
180 const char *wglext; 181 const char *wglext;
181 182
182 /* load the gl driver from a default path */ 183 /* load the gl driver from a default path */
183 if ( ! this->gl_config.driver_loaded ) { 184 if ( ! this->gl_config.driver_loaded ) {
184 /* no driver has been loaded, use default (ourselves) */ 185 /* no driver has been loaded, use default (ourselves) */
336 337
337 /* Vsync control under Windows. Checking glGetString here is 338 /* Vsync control under Windows. Checking glGetString here is
338 * somewhat a documented and reliable hack - it was originally 339 * somewhat a documented and reliable hack - it was originally
339 * as a feature added by mistake, but since so many people rely 340 * as a feature added by mistake, but since so many people rely
340 * on it, it will not be removed. strstr should be safe here.*/ 341 * on it, it will not be removed. strstr should be safe here.*/
341 wglext = (const char *)this->glGetString(GL_EXTENSIONS); 342 glGetStringFunc = WIN_GL_GetProcAddress(this, "glGetString");
342 if ( !SDL_strstr(wglext, "WGL_EXT_swap_control") ) { 343 if ( glGetStringFunc ) {
344 wglext = (const char *)glGetStringFunc(GL_EXTENSIONS);
345 } else {
346 /* Uh oh, something is seriously wrong here... */
347 wglext = NULL;
348 }
349 if ( !wglext || !SDL_strstr(wglext, "WGL_EXT_swap_control") ) {
343 this->gl_data->wglSwapIntervalEXT = NULL; 350 this->gl_data->wglSwapIntervalEXT = NULL;
344 this->gl_data->wglGetSwapIntervalEXT = NULL; 351 this->gl_data->wglGetSwapIntervalEXT = NULL;
345 } 352 }
346 if ( this->gl_config.swap_control >= 0 ) { 353 if ( this->gl_config.swap_control >= 0 ) {
347 if ( this->gl_data->wglSwapIntervalEXT ) { 354 if ( this->gl_data->wglSwapIntervalEXT ) {