realbasic-games
[Top] [All Lists]

Re: exact number of refreshes

To: <realbasic-games at lists dot realsoftware dot com>
Subject: Re: exact number of refreshes
From: "Robert Ward" <r dot ward at bangor dot ac dot uk>
Date: Thu, 29 Sep 2005 13:17:04 +0100
Delivered-to: realbasic-games at lists dot realsoftware dot com
>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...

Thanks, that sounds great. Can I just clarify a bit?

According to Apple, aglSwapBuffers swaps the 'front' and 'back' buffers.
The front buffer is presumably what's being displayed, but I'm wondering
what I do to set the back buffer to the same image?

Currently I load an Object3d with multiple images. Then loop through the
indices of the obj, setting shape appropriately and waiting. Something like:

for i = 0 to UBound(images_to_present)
    obj3d.shape = i 
    rb3dspace1.update
    ' start timer and get response
    start = microseconds
    while microseconds < start + TIME_TO_DISPLAY_IMAGE
    wend
next

Are you suggesting a solution something like:

for i = 0 to UBound(images_to_present)
    obj3d.shape = i 
    rb3dspace1.update
    for j = 1 to REFRESHES_TO_PRESENT
        aglSwapBuffers(aglGetCurrentContext())
    next
next


>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.

I can ensure that the image will be less than the refresh time, and that
the refresh time is known in advance.

Thanks again,
Rob


_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>