Example Program: box.cc

Next, the event-handlers are registered.

    glutReshapeFunc( cbReshape );
    glutKeyboardFunc( cbKeyboard );
    glutDisplayFunc( cbDrawPicture );

The reshape handler responds to window-resize events.

The display handler is what actually does the drawing.

The keyboard handler responds to key presses.