# HG changeset patch # User Sam Lantinga # Date 1140929304 0 # Node ID f1781c15934cee0f460cfa712a4d5d2b0a875cad # Parent b5d4f280c9601bd4afe9f75f8dcafabd6ba073f5 Make sure the OpenGL library is loaded before setting up OpenGL diff -r b5d4f280c960 -r f1781c15934c src/video/maccommon/SDL_macgl.c --- a/src/video/maccommon/SDL_macgl.c Sun Feb 26 03:51:08 2006 +0000 +++ b/src/video/maccommon/SDL_macgl.c Sun Feb 26 04:48:24 2006 +0000 @@ -37,6 +37,14 @@ GLint attributes [ 24 ]; /* 24 is max possible in this setup */ GLboolean noerr; + /* load the gl driver from a default path */ + if ( ! this->gl_config.driver_loaded ) { + /* no driver has been loaded, use default (ourselves) */ + if ( Mac_GL_LoadLibrary(this, NULL) < 0 ) { + return(-1); + } + } + attributes[i++] = AGL_RGBA; if ( this->gl_config.red_size != 0 && this->gl_config.blue_size != 0 && @@ -104,7 +112,7 @@ aglDestroyPixelFormat(format); #if TARGET_API_MAC_CARBON - noerr = aglSetDrawable(glContext, GetWindowPort(SDL_Window)); + noerr = aglSetDrawable(glContext, GetWindowPort(SDL_Window)); #else noerr = aglSetDrawable(glContext, (AGLDrawable)SDL_Window); #endif