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++.

  1. Login and create two directories. Name one Lib and the other Pentagon.

  2. 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.

  3. 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.

  4. Open the Project menu and add pentagon.c to the project.

  5. 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.

  6. 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.

  7. Open pentagon.c, include <windows.h>, and remove the glx header. Take a look at the code. Pretty simple looking, eh?

  8. Compile pentagon.c and fix any syntax errors.

  9. Build the program, fixing an unresolved references.

  10. 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.

  11. 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