Mercurial > sdl-ios-xcode
comparison 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 |
comparison
equal
deleted
inserted
replaced
1194:b8f167923bfc | 1195:bb6791b0a268 |
---|---|
54 | 54 |
55 NSOpenGLPixelFormatAttribute attr[32]; | 55 NSOpenGLPixelFormatAttribute attr[32]; |
56 NSOpenGLPixelFormat *fmt; | 56 NSOpenGLPixelFormat *fmt; |
57 int i = 0; | 57 int i = 0; |
58 int colorBits = bpp; | 58 int colorBits = bpp; |
59 | |
60 /* if a GL library hasn't been loaded at this point, load the default. */ | |
61 if (!this->gl_config.driver_loaded) { | |
62 if (QZ_GL_LoadLibrary(this, NULL) == -1) | |
63 return 0; | |
64 } | |
59 | 65 |
60 if ( flags & SDL_FULLSCREEN ) { | 66 if ( flags & SDL_FULLSCREEN ) { |
61 | 67 |
62 attr[i++] = NSOpenGLPFAFullScreen; | 68 attr[i++] = NSOpenGLPFAFullScreen; |
63 } | 69 } |
148 CGLSetParameter (ctx, GLI_SUBMIT_FUNC_CACHE_MAX, &cache_max); | 154 CGLSetParameter (ctx, GLI_SUBMIT_FUNC_CACHE_MAX, &cache_max); |
149 CGLSetParameter (ctx, GLI_ARRAY_FUNC_CACHE_MAX, &cache_max); | 155 CGLSetParameter (ctx, GLI_ARRAY_FUNC_CACHE_MAX, &cache_max); |
150 } | 156 } |
151 | 157 |
152 /* End Wisdom from Apple Engineer section. --ryan. */ | 158 /* End Wisdom from Apple Engineer section. --ryan. */ |
153 | |
154 /* Convince SDL that the GL "driver" is loaded */ | |
155 this->gl_config.driver_loaded = 1; | |
156 | 159 |
157 return 1; | 160 return 1; |
158 } | 161 } |
159 | 162 |
160 void QZ_TearDownOpenGL (_THIS) { | 163 void QZ_TearDownOpenGL (_THIS) { |