diff src/video/quartz/SDL_QuartzGL.m @ 1195:bb6791b0a268

Fixed OpenGL usage in Quartz target when SDL_SetVideoMode() is called without explicitly calling SDL_GL_LoadLibrary() first.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 06 Dec 2005 14:36:39 +0000
parents c96b326b90ba
children 5abff0870de2
line wrap: on
line diff
--- a/src/video/quartz/SDL_QuartzGL.m	Mon Dec 05 04:36:53 2005 +0000
+++ b/src/video/quartz/SDL_QuartzGL.m	Tue Dec 06 14:36:39 2005 +0000
@@ -57,6 +57,12 @@
     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;
@@ -151,9 +157,6 @@
 
     /* End Wisdom from Apple Engineer section. --ryan. */
 
-    /* Convince SDL that the GL "driver" is loaded */
-    this->gl_config.driver_loaded = 1;
-
     return 1;
 }