Skip to content

Commit

Permalink
Make sure the OpenGL library is loaded before setting up OpenGL
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 26, 2006
1 parent 1027dce commit 9789a78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/video/maccommon/SDL_macgl.c
Expand Up @@ -37,6 +37,14 @@ int Mac_GL_Init(_THIS)
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 &&
Expand Down Expand Up @@ -104,7 +112,7 @@ int Mac_GL_Init(_THIS)
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
Expand Down

0 comments on commit 9789a78

Please sign in to comment.