> Getting Started with OpenGL and C/C++

Getting Started with OpenGL and C/C++

If you plan to use C++ for the course, then you can pretty much follow the instructions in the book and slides. The source code from the book can be obtained here and the files needed to use glut under Windows are here. You should unzip both of these files into working directories. Then you will either need to tell Visual C++ to add the directory for the glut.h file to the include path and the directory for the glut.lib file (presumably in the same directory) to the library path before you'll be able to build an executable using glut. You can try building one of the book source files (for the first assignment, start with gasket3.c) and make sure it builds and runs correctly as a test.

If you are using a lab machine or your own linux machine, opengl and glut should have come with the distribution. On the lab machines, the appropriate libraries are in /lusr/X11/lib and the include files in /lusr/X11/include. You should put the library directory in your LD_LIBRARY_PATH if it isn't there already. A home linux machine will have different directories for these, probably /usr/X11/lib and /usr/X11/include. You can then compile an executable for one of the examples in the directory where you put the source code by executing:
cc -o gasket3 -I /lusr/X11/include -L /lusr/X11/lib -lGL -lGLU -lglut gasket3.c
or a similar command using the appropriate include and library directories.

For more information on openGL and glut, look at the openGL home page