OpenGL Introduction
CS 320
Jan. 19, 2000
This year, OpenGL's GLUT files have been added to the system directories on
all the lab machines. If you have Visual C++ installed on your personal
system, ask me how to install the GLUT files.
- Login and create a Projects directory. Copy the files
pentagon.c and quadric.c from the class home page into your
Projects directory.
- Start Visual C++ and open a new Win32 Console Application Project.
The location should be your Projects folder and the project name
should be Pentagon. Note that Pentagon will be a folder within
Projects.
- Move pentagon.c from the Projects directory to the
Pentagon directory.
- Open the Project menu and add pentagon.c to the project.
- Open the Project menu and choose Settings. Go the the Link tab.
Under Object/Library modules add Opengl32.lib, glu32.lib, and
glut32.lib . This is something you'll have to do for each new
project. You generally won't need all three libraries, but it's easiest to
get in the habit of adding them each time.
- Open pentagon.c, include
<windows.h>
, and remove the
glx header. Take a look at the code. Pretty simple looking, eh?
- Compile pentagon.c and fix any syntax errors.
- Build the program, fixing any unresolved references.
- Repeat for quadric.c .
Look at the functions init() and
display(). Can you see any correlation between the code and the images?
There are man pages on phoenix for all the functions. Lowercase all
function names. For example, if you're interested in gluCylinder(),
on phoenix type:
phoenix% man glucylinder
Thomas P. Kelliher
Wed Jan 19 10:26:10 EST 2000
Tom Kelliher