mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-20 06:25:01 +00:00
Reintroduces proper locking of the OpenGL context in macOS.
This commit is contained in:
parent
05d483bc5b
commit
34047fa60a
@ -52,16 +52,20 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
|
|||||||
|
|
||||||
- (void)drawAtTime:(const CVTimeStamp *)now frequency:(double)frequency
|
- (void)drawAtTime:(const CVTimeStamp *)now frequency:(double)frequency
|
||||||
{
|
{
|
||||||
// Draw the display now regardless of other activity.
|
[self redrawWithEvent:CSOpenGLViewRedrawEventTimer];
|
||||||
[self performWithGLContext:^{
|
|
||||||
[self.delegate openGLViewRedraw:self event:CSOpenGLViewRedrawEventTimer];
|
|
||||||
CGLFlushDrawable([[self openGLContext] CGLContextObj]);
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)drawRect:(NSRect)dirtyRect
|
- (void)drawRect:(NSRect)dirtyRect
|
||||||
{
|
{
|
||||||
[self.delegate openGLViewRedraw:self event:CSOpenGLViewRedrawEventAppKit];
|
[self redrawWithEvent:CSOpenGLViewRedrawEventAppKit];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)redrawWithEvent:(CSOpenGLViewRedrawEvent)event
|
||||||
|
{
|
||||||
|
[self performWithGLContext:^{
|
||||||
|
[self.delegate openGLViewRedraw:self event:event];
|
||||||
|
CGLFlushDrawable([[self openGLContext] CGLContextObj]);
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)invalidate
|
- (void)invalidate
|
||||||
|
Loading…
Reference in New Issue
Block a user