CS629: OpenGL/Glut Tutorial
The following tutorial assumes that you have Microsoft
Visual C++ and a Windows 95/98 machine. It is also assumed that Visual
C++ has been installed to the default directory, e.g. c:\Program
Files\Microsoft Visual Studio.
How to get OpenGL
and Glut Installed
First,
download opengl95.exe and glut32stuff.zip
from http://csis.pace.edu/~marchese
.
Second,
determine if OpenGL is installed on you computer. If you are running a
later version of Windows95, Windows 98, or Windows NT, most likely you
have it installed. To find out, look in c:\windows\system
for the files opengl32.dll and
Glu32.dll. If you find them, OpenGL is installed! If and only
if they do not exist, do the following:
Create
a special temporary directory, c:\tempogl.
Move the opengl95.exe
file into this directory.
Run opengl95.exe.
This will create the following files in the current directory:
Glu32.dll, Opengl32.dll
Gl.h, Glaux.h, Glu.h
Glaux.lib, Glu32.lib, Opengl32.lib
Copy
all files ending with .dll to the c:\windows\system
directory.
Third,
if
you have Visual C++ 6.0 installed, you probably have Gl.h,
Glaux.h, Glu.h installed in the compiler's ..\include\gl
directory.
If not, copy these files into the directory. Check also the compiler's
..\lib
directory for Glaux.lib, Glu32.lib, Opengl32.lib.
Copy
them in, if they are not there.
Fourth,
Glut will not be installed
on your system. Unzip glut32stuff.zip. It
will produce the following files:
glut32.dll, glut.h,
glut32.lib .
Copy these into their requisite directories.
Congratulations,
you are now ready to enter the fun and exciting world of OpenGL and Glut
programming!
How to use OpenGL or Glut in a
program under Visual C++:
First,
you need to let Visual C++ know that you want it to consult all the necessary
libraries. To do this, you must go under the Build menu item and
chose Settings.

A Project
Settings dialog box will pop up. You now need to select the Link
tab. Unfortunately, the Link tab is hiding. Click the half-a-tab
circled below...
...and the Link page will magically appear:

The
Object/library
modules section of this page which you are interested in is circled
in red above. Scroll to the end of this line and add the necessary *.lib
files to the list.
-
There are four libraries that you need to add: opengl32.lib,
glu32.lib,
glaux.lib, and glut32.lib.
Which of these you need depends on the specific program, but since it doesn't
hurt to have extra libs listed, I suggest you add all four.
-
That's it, everything should work.
Second:
Build
an OpenGL or Glut program:
Open Visual C++.
Select from the menu New->Project Workspace
-
Choose Console Application
Select Insert->Files Into Project
-
Find and choose Angel's book example gasket.c.
-
Compile, link and run. Ignore any compile warnings. If
you get link errors, check to see if the opengl libs have been linked in.
If not, check the above procedure.
13 September, 1999