[mmap] partial revert of 8cef8db4 to disable using mmap file reader
[videoplayer.git] / agl_getproc.cpp
blob91275ef5ceca481eb08e8590c058df427c464083
1 #include <Carbon/Carbon.h>
2 #include <AGL/agl.h>
3 #include <OpenGL.h>
5 CFBundleRef gBundleRefOpenGL = NULL;
7 void my_aglEnableMultiThreading(void)
9 CGLError err = kCGLNoError;
10 CGLContextObj ctx = CGLGetCurrentContext();
12 // Enable the multi-threading
13 err = CGLEnable( ctx, kCGLCEMPEngine);
15 if (err != kCGLNoError )
17 fprintf(stderr, "Could not enable OSX multithreaded opengl");
18 // Multi-threaded execution is possibly not available
19 // Insert your code to take appropriate action
23 //nasty ugly code because including agl.h in elsewhere causes compile errors
24 void my_aglSwapInterval(int interval)
26 AGLContext cx = aglGetCurrentContext();
28 aglSetInteger(cx, AGL_SWAP_INTERVAL, (GLint*)&interval);
30 if (interval != 0)
31 aglEnable(cx, AGL_SWAP_INTERVAL);
32 else
33 aglDisable(cx, AGL_SWAP_INTERVAL);