comparison src/video/SDL_renderer_gl.c @ 2246:75daa0792bd1

Added code to enable multi-threaded OpenGL on Mac OS X, pending Ryan's PBO/VBO changes.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 15 Aug 2007 04:04:17 +0000
parents e57a883ffa86
children 12ea0fdc0df2
comparison
equal deleted inserted replaced
2245:989fb86ad1ec 2246:75daa0792bd1
27 #include "SDL_opengl.h" 27 #include "SDL_opengl.h"
28 #include "SDL_sysvideo.h" 28 #include "SDL_sysvideo.h"
29 #include "SDL_pixels_c.h" 29 #include "SDL_pixels_c.h"
30 #include "SDL_rect_c.h" 30 #include "SDL_rect_c.h"
31 #include "SDL_yuv_sw_c.h" 31 #include "SDL_yuv_sw_c.h"
32
33 #ifdef __MACOSX__
34 #include <OpenGL/OpenGL.h>
35 #endif
32 36
33 /* OpenGL renderer implementation */ 37 /* OpenGL renderer implementation */
34 38
35 /* Details on optimizing the texture path on Mac OS X: 39 /* Details on optimizing the texture path on Mac OS X:
36 http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_texturedata/chapter_10_section_2.html 40 http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_texturedata/chapter_10_section_2.html
290 if (SDL_GL_MakeCurrent(window->id, data->context) < 0) { 294 if (SDL_GL_MakeCurrent(window->id, data->context) < 0) {
291 GL_DestroyRenderer(renderer); 295 GL_DestroyRenderer(renderer);
292 return NULL; 296 return NULL;
293 } 297 }
294 298
299 #ifdef __MACOSX__
300 /* Enable multi-threaded rendering */
301 /* Disabled until Ryan finishes his VBO/PBO code...
302 CGLEnable(CGLGetCurrentContext(), kCGLCEMPEngine);
303 */
304 #endif
305
295 if (flags & SDL_RENDERER_PRESENTVSYNC) { 306 if (flags & SDL_RENDERER_PRESENTVSYNC) {
296 SDL_GL_SetSwapInterval(1); 307 SDL_GL_SetSwapInterval(1);
297 } else { 308 } else {
298 SDL_GL_SetSwapInterval(0); 309 SDL_GL_SetSwapInterval(0);
299 } 310 }