Animation

As we have seen, the screen window will only be redrawn whenever the display callback function is invoked. This occurs automatically when the window is resized or uncovered. You can explicitly force the display callback to be invoked by issuing the function:

  glutPostRedisplay();             /* post redraw event on event queue */
which places a redraw event on the window's event queue.

To perform a simulation we obviously want to continually update the window, however, we do not want to constantly issue a stream of glutPostRedisplay functions. We need a mechanism for the window to be continually updated automatically.

In addition to the types of callback functions that we have discussed so far, there are two additional callback types that are helpful in this regard.

On to input...
Back to text fonts...
Back to the 13.016 overview...