Hi Steven,

On 6/09/09 1:53 AM, Steven Saunderson wrote:
I'm using OSG 2.8.0 and trying to synchronise my video frame generation with the
vertical retrace frequency so I get a smoother display.  Update on vertical 
retrace is
enabled.  If I call viewer.frame() too early processing is stalled until the 
next
retrace.

Is there any way for my application to check for an available buffer before 
calling
viewer.frame() ?  I'd like to use this time for other processing rather than 
waiting.

I'm not aware of anything like it. You could try to time before calling frame and after swapbuffers (which may or not be in a separate thread) but I wouldn't rely on these kinds of timings too much.

In general I don't believe it would benefit your ultimate goal (smoother display): yes, the display thread waits for retrace and thereby wastes some cycles. On the other hand if you call 'frame()' too late you might miss the next retrace altogether and quality will suffer dramatically.

Can't you decouple your processing instead by moving it to a separate thread?

Cheers,
/ulrich
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to