Mercurial > sdl-ios-xcode
comparison src/video/wincommon/SDL_wingl.c @ 1754:c67921b517c3
Date: Sun, 30 Apr 2006 14:20:05 +1000
From: Rob
Subject: [SDL] SDL pre-release
OpenGL fails on the zipped pre-release source accessible from
http://www.libsdl.org/svn.php.
Appears to be following lines in sdl_wing.c (lines 341-345):
wglext = (const char *)this->glGetString(GL_EXTENSIONS);
if ( !SDL_strstr(wglext, "WGL_EXT_swap_control") ) {
this->gl_data->wglSwapIntervalEXT = NULL;
this->gl_data->wglGetSwapIntervalEXT = NULL;
}
glGetString is a null pointer, as are other gl function pointers, so call
fails. Never looked at sdl source before, so no further than that as yet.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 01 May 2006 07:15:35 +0000 |
parents | eacc5bc01d1c |
children | ac282d472a2e |
comparison
equal
deleted
inserted
replaced
1753:5b3bb08e7dd8 | 1754:c67921b517c3 |
---|---|
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 *(*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 *)this->glGetString(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 ) { |