void barChart (void) { GLint month, k; glClear (GL_COLOR_BUFFER_BIT); // Clear display window. glColor3f (1.0, 0.0, 0.0); // Set bar color to red. for (k = 0; k < 12; k++) glRecti (20 + k*50, 165, 40 + k*50, dataValue [k]); glColor3f (0.0, 0.0, 0.0); // Set text color to black. xRaster = 20; // Display chart labels. for (month = 0; month < 12; month++) { glRasterPos2i (xRaster, yRaster); for (k = 3*month; k < 3*month + 3; k++) glutBitmapCharacter (GLUT_BITMAP_HELVETICA_12, label [k]); xRaster += 50; } glFlush ( ); }