GLUT for Windows
GLUT is installed in CL105. If you do not have access to that room and must use CL135.4, you will need to use the non-admin install instructions.
- We will be using freeglut. Get the appropriate zip file from ftp://cs.uregina.ca/pub/class/315/ftp/
- Extract the files to your PC.
- There are three files of importance: glut32.lib, glut.h, and glut32.dll
- If you are using 32-bit Windows with Visual Studio 2008, the following are the easiest places to put each of these files:
- C:\Program Files\Microsoft Visual Studio 9.0\VC\lib ---> glut32.lib
- C:\Program Files\Microsoft Visual Studio 9.0\VC\include\gl ---> glut.h
- C:\WINDOWS\System32 ---> glut32.dll
- If you are using 64-bit Windows Vista or Windows 7 with Visual Studio 2010, the following are the easiest places to put the files:
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib ---> glut32.lib
- C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\gl ---> glut.h
- C:\WINDOWS\SysWOW64 ---> glut32.dll
- If you are not an admin on the computer you are working on, put all three
files in the project folder next to your code. Change the glut.h include to
this: #include "glut.h". All project files must be in the project
directory. If you are having troubles contact your lab instructor.
Set up a GLUT program
- Start Visual Studio 2008
- Select File->New->Project
A "New Project" Dialogue box will appear.
- Expand the Visual C++ Projects Folder and click on the "Win32" folder.
- From the "Templates:" pane select Win32 Console Project
- Choose a "Name:" and a "Location:" and click "OK"
A "Win32 Application Wizard" Dialogue box will appear.
- Click on Application Settings on the left and select Empty project
A new project has now been created. Now, we will add the main program...
- Copy and Paste:
- From the main menu, select File->Add New Item...
An "Add New Item" Dialogue box will appear.
- Select C++ File(.cpp) and call this file main.cpp.
- In the editor window, cut and paste in the code.
- Insert existing files:
- Download the files you want to use.
For new projects, you can start from this GLUT template.
- Put them in the project folder.
- Add the files to your project: from the Visual Studio menu, select Project->Add Existing Item...
A dialog will appear that should list the files you put in the project folder. Select them and add them.
- Build and Run it
- You may need to link to glut32.lib. (Project->Properties expand
the Linker folder and select Input)