CS312 Lab 1:  Basic OpenGL and Event Handling

  1. Copy the demo program shapes from ~eeaton/public/cs312/handouts/gldemo/ to your own directory. Run.
  2. Write a program that opens an OpenGL window and draws a blue triangle in it.  Compile it using the -lGL and -lglut flags.
  3. Copy the program events.c and events.h from ~eeaton/public/cs312/handouts/glcode/ to your own directory. Compile and run.  Read the code to understand how it works.
  4. Try using the gdb debugger on the program events from Item 3, testing the following commands:
    1. Compile with -g flag
    2. Start gdb with "gdb <name of executable>"
    3. "list" or "l" -- lists code with line numbers
    4. "break #" or "b #" -- sets a break point at line number #
    5. "run" -- start program execution (if you have arguments, type them in after run)
    6. "print <varname>" or "p <varname>" -- print the value of named variable

What to turn in

Place your code from Step 2 into a directory named LastnameFirstname-Lab1. For example, my directory would be EatonEric-Lab1. Then create a tar archive of that directory, such that the tar file expands to the directory (not a bunch of files). Copy that tar archive into ~eeaton/submit/cs312/lab1/ to complete the submission.