CVDisplayLink instead of NSTimer

I started implementing cvDisplayLink to control the rendering cycle instead of nstimer, as described in this technical note http://developer.apple.com/mac/library/qa/qa2004/qa1385.html

Is it better to do the actual rendering in the displaylink callback itself, or should I call setNeedsDisplay in the view instead and let the main thread render?

To display directly in the callback, I need to block the opengl context, which I was hoping to avoid.

Is it possible to use cvDisplayLink for synchronization and still do on the main thread?

Thanks for any feedback ....

+7
objective-c cocoa opengl
source share
1 answer

There is no internal problem with context lock; It must be unprotected and quickly unlocked. Redrawing the main stream via -setNeedsDisplay: has a chance to skip the VBL window only because of a round trip runloop.

+3
source share

All Articles