How to tell when the frame buffer swap happened?

SDL_GL_SwapBuffers executes asynchronously, right ? So after I call
SDL_GL_SwapBuffers, how can I tell when the buffer swap actually
occurred ?

–Allen

RTFS, Luke!

According to SDL12/src/SDL_video.c, line 1392 or so, SDL_GL_SwapBuffers
just calles video->GL_SwapBuffers. This function is abstracted because it
is somewhat platform-specific. Since I am working with X11 and happen to
have the manpage for glXSwapBuffers handy, let me offer this:

   glXSwapBuffers  performs  an  implicit  glFlush  before it
   returns.  Subsequent OpenGL commands may be issued immedi?
   ately  after  calling glXSwapBuffers, but are not executed
   until the buffer exchange is completed.

So there you have it. You DON’T get informed of when the buffer is
swapped, be it immediately or on retrace. However, you don’t have to wait
for it to start issuing more commands. The drivers are at least that
smart. Yes, even the ATI and PowerVR Win32 drivers manage to do this
right - astonishing as it sounds for those steaming piles of refuse.

(You heard it here first - The Kyro’s PowerVR drivers have officially been
excepted into my personal OpenGL compliance hall of shame as of last night
when yet another hack was added to our code to support yet another brain
damaged driver which doesn’t actually provide the functions it claims to!
I’d offer a full list of previous inductees, but most of the companies in
question are no longer making 3D cards if they even still exist at all.
Gee, with such quality drivers, I wonder why?)On Fri, Mar 01, 2002 at 04:53:28PM -0500, Allen W. Ingling wrote:

SDL_GL_SwapBuffers executes asynchronously, right ? So after I call
SDL_GL_SwapBuffers, how can I tell when the buffer swap actually
occurred ?


Joseph Carter Caffiene is a good thing

Z.O.I.D.: Zombie Optimized for Infiltration and Destruction

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020302/401db49b/attachment.pgp

At 16:53 01.03.2002 -0500, you wrote:

SDL_GL_SwapBuffers executes asynchronously, right ? So after I call
SDL_GL_SwapBuffers, how can I tell when the buffer swap actually
occurred ?

Actually, SDL_GL_SwapBuffers(), which just calls glSwapBuffers(); executes
synchronously, syncronized to the next possible vertical retrace start of
your monitor after all previously issued glCommands have been executed.
Due to the speed at which computers travel nowadays (I just got remembered
at my time coding the C64), you don’t really need to ask for when the Swap
occurred. You know it will occur as fast as possible, so you can
concentrate on the next tasks after calling SwapBuffers.
(I actually count frames, when I issued all rendering commands, because
calculating and issuing commands takes most of the rendering-time … (I
love GL!))
Cheers,
St0fF.