Commit 1a4e90b8 authored by Sam Lantinga's avatar Sam Lantinga

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.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401713
parent c3d59105
...@@ -177,6 +177,7 @@ int WIN_GL_SetupWindow(_THIS) ...@@ -177,6 +177,7 @@ int WIN_GL_SetupWindow(_THIS)
int iAttribs[64]; int iAttribs[64];
int *iAttr; int *iAttr;
float fAttribs[1] = { 0 }; float fAttribs[1] = { 0 };
const GLubyte *(*glGetStringFunc)(GLenum);
const char *wglext; const char *wglext;
/* load the gl driver from a default path */ /* load the gl driver from a default path */
...@@ -338,8 +339,14 @@ int WIN_GL_SetupWindow(_THIS) ...@@ -338,8 +339,14 @@ int WIN_GL_SetupWindow(_THIS)
* somewhat a documented and reliable hack - it was originally * somewhat a documented and reliable hack - it was originally
* as a feature added by mistake, but since so many people rely * as a feature added by mistake, but since so many people rely
* on it, it will not be removed. strstr should be safe here.*/ * on it, it will not be removed. strstr should be safe here.*/
wglext = (const char *)this->glGetString(GL_EXTENSIONS); glGetStringFunc = WIN_GL_GetProcAddress(this, "glGetString");
if ( !SDL_strstr(wglext, "WGL_EXT_swap_control") ) { if ( glGetStringFunc ) {
wglext = (const char *)this->glGetString(GL_EXTENSIONS);
} else {
/* Uh oh, something is seriously wrong here... */
wglext = NULL;
}
if ( !wglext || !SDL_strstr(wglext, "WGL_EXT_swap_control") ) {
this->gl_data->wglSwapIntervalEXT = NULL; this->gl_data->wglSwapIntervalEXT = NULL;
this->gl_data->wglGetSwapIntervalEXT = NULL; this->gl_data->wglGetSwapIntervalEXT = NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment