Example Program: box.cc

At the top of the program we find global data declarations, the code for the graphics initialization, and the handlers.

Frequently the display handler calls another function that is responsible for actually constructing the scene; it's code is also found here.

In this program the global data declared in the preamble is only some vectors that make it convenient to set the drawing color. The arrays for each color contain four entries, one each for red, green, and blue, and a fourth entry for alpha; more about that later.