Hi,
in my application, I need to render 2 quartz compositions
simultaneously. Both compositions are rendered fullscreen, each to a
separate display. I use two NSOpenGLContexts and two QCRenderers to
achieve this. I also use two CVDisplayLinks to trigger the rendering
of the compositions. The compositions are extremely simple, they only
show a colored Sprite moving for a few seconds from left to right
using the Timelines patch. I also set the NSOpenGLCPSwapInterval to 1
for each of the two NSOpenGLContexts to prevent tearing.
The problem is that the animation is not entirely smooth. Sometimes,
for a fraction of a second, the sprites appear to stop moving or shake
a little bit along their path.
#1 GLint swapInterval = 1;
#2 [context1 setValues: &swapInterval forParameter:
NSOpenGLCPSwapInterval];
#3 [context2 setValues: &swapInterval forParameter:
NSOpenGLCPSwapInterval];
When I comment out either line #2 or line #3, or both, the animation
is suddenly smooth on both displays, but there is a visible tearing
(i.e. the sprite does not appear as a single rectangle, but instead as
a two or more rectangles arranged sloppily one on top of another...)
The interesting thing here is that commenting out any of the lines #2
or #3 is sufficient to solve the lagging problem. This leads me to
believe that the two rendering contexts (or CVDisplayLink threads)
somehow interfere with each other in my app, which is causing the lag.
Also, when I comment out the [context1 setFullScreen] or [context2
setFullScreen] line, the lag is also gone (but obviously, only one
composition is shown, then).
The whole App and sourcecode can be downloaded here:
http://stack.sk/Fullscreen.zip
Can somebody please help me out?
Thanks,
Miso
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]