1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-04-10 22:37:30 +00:00

Expanded on thinking.

This commit is contained in:
Thomas Harte 2016-04-06 19:35:53 -04:00
parent e885438363
commit fd1f6a7e1f

View File

@ -52,10 +52,12 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
- (void)drawAtTime:(const CVTimeStamp *)now
{
// Always post a -didUpdateToTime:. This is the hook upon which the substantial processing occurs.
// Always post a -openGLView:didUpdateToTime:. This is the hook upon which the substantial processing occurs.
[self.delegate openGLView:self didUpdateToTime:*now];
// Draw the display only if a previous draw is not still ongoing.
// Draw the display only if a previous draw is not still ongoing. -drawViewOnlyIfDirty: is guaranteed
// to be safe to call concurrently with -openGLView:updateToTime: so there's no need to worry about
// the above interrupting the below or vice versa.
const uint32_t activityMask = 0x01;
if(!OSAtomicTestAndSet(activityMask, &_updateIsOngoing))
{