From 34fc4ff01eb30baeceaecd7e2eb95d1fd0aba850 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 6 Dec 2005 14:36:39 +0000 Subject: [PATCH] Fixed OpenGL usage in Quartz target when SDL_SetVideoMode() is called without explicitly calling SDL_GL_LoadLibrary() first. --- src/video/quartz/SDL_QuartzGL.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/video/quartz/SDL_QuartzGL.m b/src/video/quartz/SDL_QuartzGL.m index 53e5d92ff..505509a1e 100644 --- a/src/video/quartz/SDL_QuartzGL.m +++ b/src/video/quartz/SDL_QuartzGL.m @@ -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; @@ -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; }