To become familiar with Magician and OpenGL programming
Write a Java program using Magician 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 java file which should be commented with your name (the name you are registered under!) and ID number. The java file should implement a class "a1" (so the TA can save it as "a1.java", compile it and execute it using the command "java a1".) The file should be emailed as ASCII text to email@example.com.
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 TA crabby and result in much tougher program grading!)
IMPORTANT: If the TA has to edit your files you will lose points. Similarly, the TA should be able to execute the class "a1", so using any other class as your main class will result in lost points.
This program is due on or before Friday, September 1st. 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 class display method.
HINT 2: You will use the standard AWT event listener interface to receive mouse events on your GLComponent. Similarly, you will probably need to call the repaint() method after processing a mouse click.
HINT 3: You will need to keep track of the size of the window (by modifying the example reshape() method) 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.