0% found this document useful (0 votes)
15 views3 pages

Installing OpenGL on Windows 7+

The document provides instructions for installing OpenGL and running code examples from a book on Microsoft Windows 7 or higher. It describes downloading and installing Microsoft Visual C++ 2010 Express, FreeGLUT, and GLEW. It then explains how to create a new project in Visual C++, add code examples to the project, build and run the project to execute the examples. It notes that examples may fail to run if the graphics card does not support OpenGL 4.3.

Uploaded by

boolxx
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views3 pages

Installing OpenGL on Windows 7+

The document provides instructions for installing OpenGL and running code examples from a book on Microsoft Windows 7 or higher. It describes downloading and installing Microsoft Visual C++ 2010 Express, FreeGLUT, and GLEW. It then explains how to create a new project in Visual C++, add code examples to the project, build and run the project to execute the examples. It notes that examples may fail to run if the graphics card does not support OpenGL 4.3.

Uploaded by

boolxx
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Installing OpenGL and Running the Book’s Code on

Microsoft Windows 7 and Higher

The development platform for all our code was a Microsoft Visual Studio
2010 IDE running on Windows 7. So, described below is how to install
a free version of that IDE on Windows 7. However, the code should run,
possibly with minor tweaks, even using later versions of Visual Studio and
on Windows 8.
Go to [Link]
and follow the links there to download and install Microsoft Visual C++
2010 Express edition. After Visual C++ has been successfully installed, do
the following.

• Install FreeGLUT:
1. Download and unzip the file [Link]
from [Link]
GLUT/[Link].
On 32-bit Windows:
(a) Copy all the files from freeglut\include\GL to C:\Program
Files\Microsoft SDKs\Windows\v7.0A\Include\GL. Note
that you may have to create the GL folder.
(b) Copy the file [Link] from freeglut\lib to C:\Program
Files\Microsoft SDKs\Windows\v7.0A\Lib.
(c) Copy the file [Link] from freeglut\bin to C:\Windows\System32.
On 64-bit Windows:
(a) Copy all the files from freeglut\include\GL to C:\Program
Files(x86)\Microsoft SDKs\Windows\v7.0A\Include\GL.
Note that you may have to create the GL folder.
(b) Copy the file [Link] from freeglut\lib\x64 to
C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0A\Lib.
(c) Copy the file [Link] from freeglut\bin\x64 to
C:\Windows\SysWOW64.
• Install GLEW:
1. Download glext.h from [Link]
api/glext.h to C:\Program Files\Microsoft Visual Studio
10.0\VC\include\GL.
2. Download and unzip the file [Link] from http:
//[Link]/.
On 32-bit Windows:
(a) Copy all the files from glew-1.10.0\include\GL to C:\Program
Files\Microsoft SDKs\Windows\v7.0A\Include\GL.
(b) Copy all the files from glew-1.10.0\lib\Release\Win32 to
C:\Program Files\Microsoft SDKs\Windows\v7.0A \Lib.
(c) Copy all the files from glew-1.10.0\bin\Release\Win32 to
C:\Windows\System32.
On 64-bit Windows:
(a) Copy all the files from glew-1.10.0\include\GL to C:\Program
Files(x86)\Microsoft SDKs\Windows\v7.0A\Include\GL.
(b) Copy all the files from glew-1.10.0\lib\Release\Win32 to
C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0A \Lib.
(c) Copy all the files from glew-1.10.0\bin\Release\Win32 to
C:\Windows\SysWOW64.

• Run a program:

1. Open Visual C++ 2010 from the Start Menu to bring up the
welcome screen.
2. Create a new project by going to File → New → Project.
3. Select Win32 from the Installed Templates panel and then Win32
Console Application from the next panel. Name your project
and select the folder where you want to save it. Uncheck the box
which says “Create directory for solution”. Click OK to bring up
a wizard welcome window.
4. Click Application Settings for the settings dialog box.
5. Uncheck the Precompiled header box, check the Empty project
box and choose Console application. Click Finish to see a new
project window.
6. Right click on Source Files and choose Add → New Item to bring
up a dialog box.
7. Select Code from the Installed Templates panel and C++
File(.cpp) from the next panel. Name your file and click Add to
see an empty code panel in the project window titled with your
chosen name.
8. Copy any of our book programs into or write your own in the
code panel.
9. Save and build your project by going to Debug → Build Solution.
Then execute the program with Debug → Start Debugging. If
the program has been built successfully, then you should see no
2 error in the output window.
Note: If your graphics card doesn’t support OpenGL 4.3 then a book pro-
gram may compile but not run as the system is unable to provide the OpenGL
4.3 rendering context asked by the command glutInitContextVersion(4,
3) in the main routine. What you might do in this case is replace
glutInitContextVersion(4, 3) with glutInitContextVersion(3, 3),
or even glutInitContextVersion(2, 1), instead. Of course, then,
programs using later-generation calls will not run, but you should be fine
early on in the book.

You might also like