How to setup GLUT and
GLUI in visual c++
By Leong chen ki @ Roger
What is GLUT?
Because OpenGL (www.opengl.org) doesn't provide routines for interfacing with a windowing system or input devices, an application must use a variety of other platform-specific routines for this purpose. The result is nonportable code.
Furthermore, these platform-specific routines tend to be full-featured, which complicates construction of small programs and simple demos.
GLUT is a library that addresses these issues by providing a platform-independent interface to window management, menus, and input devices in a simple and elegant manner. Using GLUT comes at the price of some flexibility.
A large amount of information on GLUT is at the GLUT FAQ:
http://reality.sgi.com/mjk/glut3/glut-faq.html.
What is Open-GL?
OpenGL® is a low-level API that combines the
ability to render top quality 3D graphic images. It is basically a library that
consists of hundreds or thousands sets of function to provide the flexibility
for programmer to create 3D graphic images. 3D games such as quake 1,2,3,
counter strike, half life, unreal and unreal tournament are using open-gl to do
the 3D part of the game. Open-gl is also used in visualizing data (create
atomic, molecular 3D stucture) and even military purposes for creating a 3D
map. Those pre-rendered movies such as The bugs life are also an indirect usage
of open-gl.
1,
download open-gl SDK (glut 3.7) http://reality.sgi.com/opengl/glut3/glut3.html
and GLUI package from http://www.cs.unc.edu/~rademach/glui/
2, make
sure there are folders named GL in included in the glut package
3, copy
the folders to the include folder where the visual c++ is installed
4, copy
the folders in the lib folders in glut3.7 package to the lib folder in the
visual c++ folder and copy the glui.h to the "include" folder in
visual c++ and glui.lib from the glui package to the "Lib" folder in visual c++
5,
setup the copied folder in vc++: tools > option > directories to include the relevant folder in LIB and
INCLUDE so the compiler will know where the header file (.h) and library file
locate at (.lib)
6,
Start VC++ and create a new project.
7. The
project has to be a "Win32 Console Application"
8. Type
in the name of the project and where it will be on your hard drive.
9.
Chose an empty project and click next or finish
10.
First thing you need to do when the project opens up is to click on the
"Project" menu item from the top.
11.
Chose "Settings" (a window will come up)
12. On
the left side of the window there are tabs, chose the "Link" tab
13. The
string field labeled "Object/library modules" has a few lib files
already set in it
14. Go
to the end of this string field and enter:
opengl32.lib
glut32.lib glu32.lib glui32.lib
15,
Make sure the header file is included with project> add files everytime
glui.h is needed as glui.h is not a pre-compiled library.