Example Program: box.cc

The first function is drawBoxes(). This does all the drawing in the program. The initial block of code is

    glColor4fv( red );
    glBegin( GL_LINE_STRIP );
    glVertex2f( -0.7, -0.7 );
    glVertex2f(  0.7, -0.7 );
    glVertex2f(  0.7,  0.7 );
    glVertex2f( -0.7,  0.7 );
    glVertex2f( -0.7, -0.7 );
    glEnd();