OpenGL Introduction
CS 320
Jan. 28, 1998
This will get the library files onto your G: drives (which you only
have to do once) and give you a little practice with OpenGL and Visual C++.
- Login and create two directories. Name one Lib and the other
Pentagon.
- Ftp to phoenix (there's a nice GUI-based ftp utility now ---
cutftp32) and copy (binary mode) the GLUT files from
~kelliher/pub/cs320/
into your Lib directory and
pentagon.c into Pentagon.
- Start Visual C++ and open a new Win32 Console Application Project.
The location should be your Pentagon folder and the project name
should be Pentagon. Before leaving the dialog box, double-check the
location and fix the minor inconvenience you'll find there.
- Open the Project menu and add pentagon.c to the project.
- Open the Tools menu and choose Options. From there go to the
Directories tab. Add your Lib directory to the Include and Library
directories. This should be the only time you have to do this.
- Open the Project menu and choose Settings. Go the the Link tab.
Under Object/Library modules add Opengl32.lib and glut32.lib .
This is something you'll have to do for each new project.
- 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 an unresolved references.
- Attempt to run the program. Notice that you'll have to copy
glut32.dll
to the project's debug directory. Do that and run the
program.
- Repeat for quadric.c . This time you'll need
Glu32.lib
. 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
Mon Jan 26 19:27:18 EST 1998
Tom Kelliher