mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-23 03:32:32 +00:00
Ensures new displayLinkDelegates get a nudge with the initial display link.
This commit is contained in:
parent
e7410b8ed8
commit
e1cbad0b6d
@ -22,6 +22,8 @@
|
||||
NSTrackingArea *_mouseTrackingArea;
|
||||
NSTimer *_mouseHideTimer;
|
||||
BOOL _mouseIsCaptured;
|
||||
|
||||
id<CSOpenGLViewDisplayLinkDelegate> _displayLinkDelegate;
|
||||
}
|
||||
|
||||
- (void)prepareOpenGL {
|
||||
@ -70,6 +72,23 @@
|
||||
CVDisplayLinkStart(_displayLink);
|
||||
}
|
||||
|
||||
- (void)setDisplayLinkDelegate:(id<CSOpenGLViewDisplayLinkDelegate>)displayLinkDelegate {
|
||||
@synchronized(self) {
|
||||
_displayLinkDelegate = displayLinkDelegate;
|
||||
|
||||
// Seed with the current _displayLink, if any.
|
||||
if(_displayLink) {
|
||||
[displayLinkDelegate openGLView:self didUpdateDisplayLink:_displayLink];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (id<CSOpenGLViewDisplayLinkDelegate>)displayLinkDelegate {
|
||||
@synchronized(self) {
|
||||
return _displayLinkDelegate;
|
||||
}
|
||||
}
|
||||
|
||||
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *now, const CVTimeStamp *outputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext) {
|
||||
CSOpenGLView *const view = (__bridge CSOpenGLView *)displayLinkContext;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user