Precise screen synchronization

Hello, I am creating a double-buffered SDL application. This application
requires that I synchronize buffer swaps to the VBL to avoid tearing and that I
send a signal to the serial port as soon as the display has been updated with
the new frame. Is there any way to know when the buffer swap that I requested
has been executed? A blocking buffer-swap call would suffice for my purposes.
Thank you.

Best, Dan

Hello, I am creating a double-buffered SDL application. This application
requires that I synchronize buffer swaps to the VBL to avoid tearing and that I
send a signal to the serial port as soon as the display has been updated with
the new frame. Is there any way to know when the buffer swap that I requested
has been executed? A blocking buffer-swap call would suffice for my purposes.
Thank you.

It depends on whether you are using OpenGL or not. I am not sure of the
answer for OpenGL. For pure SDL using hardware double buffering, then
the SDL_LockSurface blocks until a swap has occurred and it is safe to
access the back buffer. The SDL_Flip function is not blocking. It just
sets up a swap and returns.

	Bob PendletonOn Fri, 2006-09-15 at 19:52 +0000, Daniel Rizzuto wrote:

Best, Dan


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+