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.

  1. Login and create a Projects directory. Copy the files pentagon.c and quadric.c from the class home page into your Projects directory.

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

  3. Move pentagon.c from the Projects directory to the Pentagon directory.

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

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

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

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

  8. Build the program, fixing any unresolved references.

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