Re: help -- timing problem

New Message Reply Date view Thread view Subject view Author view

From: Phil Keslin (philk++at++cthulhu.engr.sgi.com)
Date: 01/11/2000 13:30:04


Yair Kurzion wrote:
>
> > I need to know the exact time when the graphics card swaps the buffers by
> > following method:
> >
> > glXSwapBuffers
> > glXWaitVideoSyncSGI
> >
> > The glXSwapBuffers only issues the command to swap the buffers and returns
> > immediately before the buffers are actually swapped. The command will be
> > completed during the next vertical retrace. So, after glXSwapBuffers
> > returns, the program calls glXWaitVideoSyncSGI to determine the vertical
> > retrace.
> >
> > Now the problem is that when the glXSwapBuffers returns, sometimes the
> > vertical retrace occurs, the graphics card swaps the buffers before the
> > program calls glXWaitVideoSyncSGI. Therefore the returning time of
> > glXWaitVideoSyncSGI will be one frame later then the actual swapping time
> > of the buffers.
> >
> > Any good method to resolve the problem? Is there any method to access the
> > codes that determine the actual swapping of the buffers?
>
> Instead of glXWaitVideoSyncSGI, call
>
> glNormal3f(0.0f, 1.0f, 0.0f);
>
> (Or any other OpenGL call). This will block until swapbuffers, and will not
> wait an extra frame as in your case.
>

This behaviour is implementation specific. On SGI systems, the application will
wait until the swap is completed before proceeding.

- Phil

-- 
Phil Keslin <philk++at++engr.sgi.com>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Jan 11 2000 - 13:30:08 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.