
Untitled
By: a guest on
May 14th, 2012 | syntax:
Objective C | size: 0.55 KB | hits: 28 | expires: Never
- (void) drawView
{
[[self openGLContext] makeCurrentContext];
// We draw on a secondary thread through the display link
// When resizing the view, -reshape is called automatically on the main thread
// Add a mutex around to avoid the threads accessing the context simultaneously when resizing
CGLLockContext((CGLContextObj)[[self openGLContext] CGLContextObj]);
g_Render();
CGLFlushDrawable((CGLContextObj)[[self openGLContext] CGLContextObj]);
CGLUnlockContext((CGLContextObj)[[self openGLContext] CGLContextObj]);
}