
OpenGL Annimation
This domucment is a brief overview of Annimation with OpenGL
Animation in computer rendered OpenGL is achieved through the use of double
buffering. Double buffering provides two complete color buffers for
use in drawing. The frame in one buffer is displayed while the the
frame in the other buffer is being drawn. When the drawing of a frame
is complete the two buffers are swapped so that the one that was being
viewed is now used for drawing.
OpenGL does not provide a command for buffer swapping since it is up to
the windowing system to provide and control the buffers.
The tk library provides the command tkInitDisplayMode to specify use of two color
buffers for double buffering. The tk command tkSwapBuffers() must
be called to swap between the two buffers. This command is generally
called at the end of the drawing procedure after a call to glFlush().
Animation is achieved in the event loop by assigning the drawing
procedure to be the procedure called when no events are received. This
is done using the command tkIdleFunc().