0% found this document useful (0 votes)
96 views2 pages

How To Install Visual C++ Express: 3.1 Installing VC++, Opengl, Glu and Glut

This document provides instructions for installing Visual C++, OpenGL, GLU, and GLUT on Windows. It describes downloading and installing Visual C++ 2010 Express, the Windows SDK which includes OpenGL and GLU, and Nate Robin's GLUT library. It also provides steps for creating a new Visual C++ project and code file to write a simple OpenGL program using GLUT.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views2 pages

How To Install Visual C++ Express: 3.1 Installing VC++, Opengl, Glu and Glut

This document provides instructions for installing Visual C++, OpenGL, GLU, and GLUT on Windows. It describes downloading and installing Visual C++ 2010 Express, the Windows SDK which includes OpenGL and GLU, and Nate Robin's GLUT library. It also provides steps for creating a new Visual C++ project and code file to write a simple OpenGL program using GLUT.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

3.

1 Installing VC++, OpenGL, GLU and GLUT

You need to install:

1. Visual C++ Express 2010: Read "How to install Visual C++ Express". VC++ would be
installed in "C:\Program Files\Microsoft Visual Studio 10.0\VC", with headers
in sub-directory "include" and libraries in "lib".
2. Windows SDK which includes OpenGL and GLU (OpenGL Utility). The Visual C++
2010 Express bundles the Microsoft Windows SDK, which would be installed in
"C:\Program Files\Microsoft SDKs\Windows\v7.0A". (Otherwise, you need to
download and install the Windows SDK separately).
The followings are used from Windows SDK:
o gl.h, glu.h: header for OpenGL and GLU in directory "C:\Program
Files\Microsoft SDKs\Windows\v7.0A\include\gl".
o opengl32.lib, glu32.lib: libraries for OpenGL and GLU in directory
"C:\Program Files\Microsoft SDKs\Windows\v7.0A\lib".
o opengl32.dll, glu32.dll: dynamic link libraries for OpenGL and GLU in
directory "C:\Windows\System32". This directory is to be included in PATH
environment variable.

If you use the VC++ IDE, the include-path and lib-path would have been set correctly. If
you use the CMD shell, you need to run the batch file "vcvarsall.bat" (in
"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin"), or "vcvars32.bat"
in the earlier version, to set the environment variables.

3. GLUT (OpenGL Utility Toolkit): Download Nate Robin's original Win32 port of GLUT
from @ http://www.xmission.com/~nate/glut.html (or freeglut @
http://freeglut.sourceforge.net). Unzip and copy "glut.h" to "C:\Program
Files\Microsoft SDKs\Windows\v7.0A\include\gl", "glut32.lib" to
"C:\Program Files\Microsoft SDKs\Windows\v7.0A\lib", and "glut32.dll" to
"C:\Windows\System32" (that is, the same locations as OpenGL and GLU).

3.2 Writing Your First OpenGL Program

To Write your first OpenGL program with GLUT:

1. Launch Visual C++ 2010 Express.


2. Create a new "Win32 Console Application" project: Select "File" menu ⇒ New ⇒
Project... ⇒ In "Project Types", select "Visual C++", "Win32". In "Templates", select
"Win32 Console Application". In "Location", set your working directory. In "Name",
enter "hello" ⇒ Next ⇒ Check "Empty Project" ⇒ Finish.
3. Create a new Source file: Right-click on the "Source Files" of the project name ⇒ Add ⇒
New Item... ⇒ In "Categories", select "Visual C++", "Code". In "Templates", select "C++
File (.cpp)". In "Name", type "GL01Hello.cpp" ⇒ Add.
4. In the editor panel for "GL01Hello.cpp", replace with the above code (in the previous
section).
5. Build the solution ("Build" menu ⇒ Build Solution) and run the program ("Debug" menu
⇒ "Start Without Debugging").

You might also like