To become familiar with GLUT and OpenGL programming in the SGI lab
Write a C program using GLUT and OpenGL calls to create a grid whose squares change color when clicked on. Specifically, you should divide the window into a grid of 10 squares horizontally by 10 squares vertically and draw lines on the screen to show the grid pattern. Each grid square should start out black, and change to a new color wheneven the user clicks a mouse button within it.
Your program should consist of a single file which should be commented with your name and any instructions needed for compiling and running your program. This should be emailed as ASCII text to cs4451@cc.gatech.edu. Put the exact compilation command on a separate line in your mail message, so that the TA can cut and paste it to compile your program, or include a Makefile. (All future assignments will require a Makefile be included.)
The time the mail is received will be used to determine whether or not the program is late, so be sure to allow a couple of minutes for the mail system to transmit your file if you are working right up to the deadline. If necessary to send multiple files, tar them and then uuencode the results before mailing. (Using MIME attachments to turn in files will make the grader crabby and result in much tougher program grading!)
IMPORTANT: If the TA has to edit your files, including your Makefile, you will lose points. Similarly, if you don't include a Makefile, the TA must be able to cut and paste the compilation commands from your email message.
This program is due on or before Friday, September 3rd. This means it must be received by 11:59pm EDT on Friday to not be considered late.
At a minimum, your program should create a window of at least 500x500 pixels, and use grid lines 1 pixel wide.
HINT 1: you will need to keep track of the color of each square (possibly in a double dimension array) so the screen can be redrawn correctly by your GLUT display callback.
HINT 2: glutPostRedisplay will probably need to be called in your glutMouseFunc (whatever callback function you write to handle mouse button presses).
HINT 3: you will need to keep track of the size of the window (by specifying a glutReshapeFunc) and use this window size to determine which square the mouse is in, based on the mouse position when a button is pressed.
There are no extra credit options on this assignment.