One of my earlier blogs, OpenGL and glut in C++ with MS Visual Studio 2008 (MSVS9)described how to set up your Visual Studio and Computer to work with glut, as well as OpenGL. Now with the new edition, Microsoft Visual Studio 2010, as the version shifted from v6.0A to v7.0A, we need to change some path.So, here goes, what we need to do for using glut in MSVS10:
OpenGL support come with many IDEs, programming environments and compilers. Likewise MSVS9 comes with built in support for OpenGL so that you can use all features of gl and glu libraries simply. To use glut support we need to download and add the glut support. Let us do both one by one.
OpenGL (gl and glu)
Hopefully you have already installed MS Visual Studio 2008 or MS Visual C++ 2008. If so, let us do the following,
Create an empty C++ Win32 application.
From File menu select New → Project (Ctrl+Shift+N).
Select Win32 Project, enter a Name, and click OK.
In the Wizard click Next, then check the box next to Empty Project, and click Finish.
Add a new C++ source file
Under the Project menu select Add New Item (Ctrl+Shift+A).
Select C++ File (.cpp), enter a Name, and click OK.
Link to the OpenGL libraries
Under the Project menu select Project Properties (Alt+F7) at the bottom.
Select Configuration Properties → Linker → Input from the navigation panel on the left.
Select All Configurations from the Configuration drop-down box at the top of the dialog. This ensures you are changing the settings for both the Debug and Release configurations.
Type “opengl32.lib glu32.lib” in Additional Dependencies and click OK.
Now, you can start coding. You can download GLDemo.cpp to begin with a demo that, if executed(Cntrl+F5), will show a window with blue triangle.
GLUT with a Win32 console application
Download and Install GLUT
Assuming, you already have MSVS9 installed, you have OpneGL libraries installed and placed in exact places. But, if one need to use the functionality of glut library it is necessary to download and install the very library. Please, do the following:
I faced some problem in using OpenGL libraries and GLUT library and eventually found some solution from the web. Hence I am posting this blog to share some help in one place that may help other guys and girls.