CS312 Lab 1: Basic OpenGL and Event Handling
- Copy the demo program shapes from ~eeaton/public/cs312/handouts/gldemo/
to your own directory. Run.
- Write a program that opens an OpenGL window and
draws a blue triangle in it. Compile it using the -lGL and -lglut flags.
- 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.
- Try using the gdb debugger on the program events
from Item 3, testing the following commands:
- Compile with -g flag
- Start gdb with "gdb <name of executable>"
- "list" or "l" -- lists code with line numbers
- "break #" or "b #" -- sets a break point at line number #
- "run" -- start program execution (if you have arguments, type
them in after run)
- "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.