1 #include <Carbon/Carbon.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
);
31 aglEnable(cx
, AGL_SWAP_INTERVAL
);
33 aglDisable(cx
, AGL_SWAP_INTERVAL
);