On 28-Sep-05, at 10:50 AM, Robert Ward wrote:
I need to present a series of images for an exactly specified
number of
screen refreshes. I've had good success in OS X using agl declares to
swap in new images during the vertical blanking. So I can get flicker-
free presentations, swapping cleanly between 2 images at the screen's
refresh rate. That's the first part. But now I want to, for example,
present image1 for exactly 2 refreshes, followed by image2 for
exactly 3
refreshes.
What I'd really like to do is to be able to count the number of
blanking
intervals. Is there an agl declare or some other method that allows
that?
Assuming your framerate is always maxed out to the refresh rate you
should be able to just call aglSwapBuffers multiple times for each
image. Each buffer swap will block until the next refresh when VBL
sync is enabled, so just swap buffers twice for image1 and swap three
times for image2...
The only problems you might encounter with this are when frame take
longer than 1 swap interval to draw (the previous frame may stay up
longer in that case) and dealing with different refresh rates, unless
you can guarantee 72 Hz is always available.
Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|