CS312 Lab 1: Basic OpenGL and Event Handling
- Use the debugger -- gdb/lldb 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
- Copy the demo program shapes from ~dxu/handouts/cs312/gldemo to your own directory (note that there are two subdirectories mac and linux. Choose the correct binary for your current machine architecture). Run.
- Make sure you try out the menus attached under right-click (control-click on macs)
- Also try toggling the following key commands:
- 'B'
- 'C'
- 'O' (only visible under TRIANGLE_FAN, TRIANGLE_STRIP and QUAD_STRIP)
- escape
- Copy the programs simple.c hello_gl.c from ~dxu/handouts/cs312/glcode to your own directory
- Copy Makefile from ~dxu/handouts/cs312/glcode to your own directory
- Compile each with "make <name without .c>" and run.
- Write a program that opens an OpenGL window and draws a blue triangle in it.
- Copy the program events.c from ~dxu/handouts/cs312/glcode to your own directory. Compile and run.
- Write a program that draws a small circle/square at every mouse-click.