Skip to content

Commit

Permalink
Fixed OpenGL usage in Quartz target when SDL_SetVideoMode() is called…
Browse files Browse the repository at this point in the history
… without

 explicitly calling SDL_GL_LoadLibrary() first.
  • Loading branch information
icculus committed Dec 6, 2005
1 parent 542d9d5 commit 34fc4ff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/video/quartz/SDL_QuartzGL.m
Expand Up @@ -57,6 +57,12 @@ int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags) {
int i = 0;
int colorBits = bpp;

/* if a GL library hasn't been loaded at this point, load the default. */
if (!this->gl_config.driver_loaded) {
if (QZ_GL_LoadLibrary(this, NULL) == -1)
return 0;
}

if ( flags & SDL_FULLSCREEN ) {

attr[i++] = NSOpenGLPFAFullScreen;
Expand Down Expand Up @@ -151,9 +157,6 @@ int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags) {

/* End Wisdom from Apple Engineer section. --ryan. */

/* Convince SDL that the GL "driver" is loaded */
this->gl_config.driver_loaded = 1;

return 1;
}

Expand Down

0 comments on commit 34fc4ff

Please sign in to comment.