Originally posted by: xtknight
Instead, the third buffer is filled with whatever is current. And if the third buffer is empty, then lag will be introduced while it is filled.
http://wiki.allegro.cc/Triple_buffering
When using triple buffering you instead set this second, recently drawn, screen in a waiting line. As soon as the graphics hardware detect that the first screen is finished drawing, it starts to draw the second screen. Meanwhile you can draw on the third screen. Triple buffering eliminates the wait for the vertical sync (vsync()).
It would seem to me, then, that this would introduce inconsistent motion but I suppose that's inevitable. VSync serves only to prevent the tearing.
As long as I'm confused, I will try to put out a few points to see where we agree or disagree. I'm not sure this helped but it raised a few questions:
http://c2.com/cgi/wiki/quickDiff?TripleBuffer
A. The third buffer is a place in memory that can be drawn to at any time, and it is constantly changing.
B. The third buffer does not necessarily contain a full frame at any given time.
C. The third buffer exists because the double buffer can not be read from or written to at the same time (i.e., synchronization). [FALSE?]
D. The second buffer is a place that contains only full frames.
E. The second buffer is updated when the next full frame is received from the third buffer. It's possible some full frames might be discarded from the second buffer because a new full frame exists.
F. At least with VSync on, a swap occurs between the first and second buffer after VBLANK.
Edit: removed a few unsure statements from this post but it would be nice if these could be clarified by those in the know.