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:
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
If you find that you have linker errors and the OpenGL functions are not being found, it may be that the frameworks are not properly set up. Use the following steps to fix this:
- In the project navigator, select the project (this will bring up a properties screen in the main window)
- Select the target
- Go to the 'Build Phases' tab
- Open the 'Link Binaries With Libraries' drop down area
- Click the '+' button
- Select 'GLUT.framework' and 'OpenGL.framework'
If you want to run OpenGL on a Unix platform or under Visual C++ on your own system, you may need to install one or more of these libraries. Here are some pointers that provide information about OpenGL, Mesa, and GLUT.
OpenGL Links
- 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.)
|