This page is under construction and some links may not work.
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 the linker. Microsoft has an infuriating tendency to move these around from version to version. For example, on my earlier installation of Visual Studio Express 2010 these were in a subfolder of C:\Program Files\Microsoft SDKs\Windows\v7.0A. Later, when I installed Visual Studio Professional 2012, they were in a subfolder of C:\Program Files\Windows Kits\8.0. (On 64-bit machine use "Program Files(x86)".) I don't know whether there is a clean way to find our which directory. One way is to run "regedit" and hunt for the value of the registry variable:
The value of this variable is the name of the directory where the SDK is stored. Look for the "Lib" subfolder. Then hunt around the subfolders branching off of here for, for example, opengl32.lib.
- Definition files gl.h and glu.h are stored somewhere accessible to your C/C++ compiler. (See the comment above about Microsoft SDKs.)
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 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 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.
- 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 Home Page:
- Lots of information about OpenGL.
- Mesa Page:
- Check here for documentation Mesa, a freely available implementation of OpenGL.
- OpenGL "Red Book"
- The official title is the "OpenGL Programming Guide", but it is widely called the "Red Book."
- OpenGL "Blue Book"
- The official title is the "OpenGL Reference Manual", but it is widely called the "Blue Book." It is the Official Reference Document to OpenGL.
- 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.)