|
GLUT, the Open GL Utility Toolkit, provides a simple, operating system independent windowing system for use with OpenGL. It provides standard facilities for creating and manipulating windows in which OpenGL output is displayed and for handling mouse and keyboard input from the user and for presenting simple menus.
Development of glut ceased in the late 1990’s. A short time later, development of freeglut commenced and over time it became an accepted replacement. While there are other alternatives, the consistency of freeglut with code in the text makes it an excellent choice for the course.
Freeglut is available for download from the development web site at SourceForge. You can use the stable release, version 2.4.0, or the release candidate, version 2.6.0. I’m using the RC and it appears to be very stable but there is always some risk with release candidate versions. Choose the version you want, download it, and extract the files from the zip archive. With a little luck, you can use freeglut.dll as delivered and I suggest you start that way.
The installation instructions on the freeglut web site are for linux. The following instructions apply to Microsoft Windows. You will find some small variations depending on which version of Windows you are running, XP, Vista, or7, and whether it is the 32-bit, x86, version or the x64 version. Installation involves copying several files from the distribution to various places on your system. You will need administrator privileges to do this since some of the files go inot protected or system directories
freeglut.dll: Copy from the Debug directory of the distribution to the windows\system or windows\system32 directory if you are running a 32-bit version of windows. Copy to windows\sysWOW32 if you are running a 64-bit version.
includes: Copy the 4 .h files from the include\GL directory into ...\Microsoft Visual Studio xx\VC\include\GL for your installation of Visual Studio where xx indicates the version number. You will probably have to create the GL folder in include.
freeglut.lib: Copy from the Debut directory of the distribution inot ...\Microsoft Visual Studio xx\VC\lib
Test the installation by attempting to run one of the gasket.exe program from the Windows Binaries folder of the source code distribution from the text web site. It it does not run, you may need to recompile it. To copile a program from the author’s source distribution, open a new project in Visual Studio and select C or C++ as the language and Win32 Console Application from the list of project types. (Do not use C#.) Enter a project name of your choosing. In the Application Wizzard -> Application Settings, Console application and Empty project should be selected. Click finish. Then right click Source Files in the Solution Explorer and select Add -> Existing item and browse to the file you want to compile. Then try to run the newly compiled program.
If you are still having problems, you may need to recompile freeglut. To do that, simply open an existing project in VS and choose among the available project files that will work for your version of VS in the base directory of the freeglut distribution. Use freeglut_vs2008.vcproj for VS 2008 and freglut.dsp for earlier versions of VS. If you are asked to update the project file to your version of VS, accept. After recompiling, copy the new versions of freeglut.dll and freeglut.lib as indicated above. No need to copy the includes as they are not changed.
If this doesn’t work, send me an precise description of what you have done and the exact error message you are getting. I screen clipping is often the best way to capture error messages.
|