raytraced image (origin unknown)

Warning: This file is copied from last semester. If you spot errors or broken links, please let me know so I can update it.

OpenGL and General Graphics Information

The OpenGL and GLUT libraries are widely available libraries for interactive graphics. There is a freely available version of OpenGL available on the web called Mesa (see the links below).

To get started quickly, we have provided a Sample OpenGL Program, which you can downloaded. The file contains both the sample program and instructions for compiling it on the various platforms given below.

Here is more information on where to find OpenGL and GLUT on the various systems at the University of Maryland.

PC's with Visual C++:
OpenGL/GLU comes bundled as part of Microsoft Windows. There are three basic elements:
  • Dynamic link libraries files opengl32.dll and glu32.dll are stored in the main system directory where other dlls are stored (e.g., C:\WINDOWS\system32).
  • Lib files opengl32.lib and glu32.lib are stored somewhere accessible to your linker. (On my machine with Visual Studio Express 2010, these appear in C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib, and with Visual Studio 2012, they appear in C:\Program Files\Windows Kits\8.0\Lib\win8\um\x86, but yours may differ.)
  • Definition files gl.h and glu.h are stored somewhere accessible to your C/C++ compiler. (On my machine, these appear in C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\gl, and with Visual Studio 2012, they appear in C:\Program Files\Windows Kits\8.0\Include\um\gl, but yours may differ.)

The glut library (glut32.dll, glut32.lib, and glut.h) are not part of the standard Windows, but can be downloaded for free. (See the GLUT information below). Here are two pages with information on setting up and using OpenGL on Windows systems.

Here is a web page from the University of Iowa on how to install GLUT. Note: If you are on a 64-bit machines you may need to place glut32.dll in a different directory than the one listed there. (On my 64-bit machine, I placed glut32.dll in "C:\Windows\SysWOW64".)

Free versions of Visual Studio 2010 and 2012 can be downloaded from Microsoft Dreamspark. This provides a C++ compiler, IDE, and a good debugger. You will need set up an account with Windows Live and specify your institution as the University of Maryland. I downloaded Visual Studio Express 2010, and it seems to work fine.

CSIC Linux Labs:
In the CSIC Linux Labs, the OpenGL and Glut headers files are located in /usr/include/GL (glut.h, gl.h, and glu.h) and the libraries are located in /usr/lib (libGL.so, libGLU.so, and libglut.so). The OpenGL include files are located in /usr/include/GL and the Glut include file is located /usr/local/freeglut/include/GL. (Redhat dropped support for Glut because it was too hard to configure and compile. Freeglut is essentially the same, and much easier to work with.)
Mac OS with Xcode:
Mac OS provides OpenGL, GLUT, and a C++ compiler through Xcode, which is freely available. Here are instructions for creating an OpenGL project with C++ and GLUT.
  • Get XCode
  • In Xcode, do → New Project → OS X Application → Command line tool (type C++ stdc++)
  • Right click your project on the left, add frameworks "OpenGL" and "GLUT"
  • Write your code in the main file (e.g., copy and paste the sample C++ code)
  • Use these headers: "#include <GLUT/GLUT.h>" and "#include <OpenGL/OpenGL.h>"
  • Build and Run
JOGL — OpenGL in Java:
JOGL is a Java package that provides bindings to the OpenGL libraries for the Java Virtual Machine. I have fairly little experience with it, but I have heard from students that it works reliably. Here are some useful links.
  • The JOGL page from JogAmp, a 3D Java project.
  • A JOGL Tutorial written by a former Maryland student. (Warning: It is rather old, and the information may be out of date.)
  • A tutorial for setting up JOGL in Eclipse.

OpenGL Links

OpenGL Home Page:
Lots of information about OpenGL.
Mesa Page:
Check here for documentation Mesa, a freely available implementation of OpenGL.
Online Documentation for OpenGL
This has many useful links to OpenGL reference documentation.
NeHe Productions Game Development Page:
Lots of information about OpenGL and game development in general, along with useful tutorials.

The GLUT Toolkit

Nate Robins GLUT for WIN32:
The easiest way to download GLUT for Windows (9X, ME, NT, 2000, and XP). See the README-Win32 file for an explanation of where to put the various files.
GLUT Home Page:
Contains information on downloading and installing GLUT, an toolkit library for OpenGL, which will be needed in our projects. (This contains pre-compiled binary downloads for both Solaris and Windows 9X, 2000, NT and XP.)
freeglut Home Page:
freeglut is a completely OpenSourced alternative to the GLUT library. It is particularly recommended for Linux users.

OpenGL Documentation on the Web

OpenGL Documentation:
A good reference for OpenGL, GLU, and GLUT commands.
Microsoft MSDN OpenGL Documentation:
This contains both reference material on OpenGL and Glu. (If this link is broken, go to the MSDN Library Page and search for "OpenGL".)
OpenGL Tutor:
This is a program (by Nate Robbins) that allows the user to interactively adjust various OpenGL settings and see the results. (Installation required.)

-   CMSC 427 Home   -

Web Accessibility