1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-19 23:32:28 +00:00

Made sure GL context isn't activated until it's locked.

This commit is contained in:
Thomas Harte 2016-03-19 22:54:56 -04:00
parent a546277f88
commit 4c5d66c317

View File

@ -133,8 +133,8 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
- (void)performWithGLContext:(dispatch_block_t)action - (void)performWithGLContext:(dispatch_block_t)action
{ {
[self.openGLContext makeCurrentContext];
CGLLockContext([[self openGLContext] CGLContextObj]); CGLLockContext([[self openGLContext] CGLContextObj]);
[self.openGLContext makeCurrentContext];
action(); action();
CGLUnlockContext([[self openGLContext] CGLContextObj]); CGLUnlockContext([[self openGLContext] CGLContextObj]);
} }