Monday, December 7, 2009

OpenGL Installation and Testing

In this tutorial I will show how to install and running OpenGL on your windows machine. Here I will show how to setup OpenGL on visual Studio 2008. If you are using visual studio 2005 take a look here.

OpenGL at visual studio 2005.


If you are using visual c++ 6.0 take a look here

OpenGL at visual c++ 6.0

First of all you need to collect OpenGL library from here

GLut Library

Download the latest stable version (3.7.6 currently!). Download the bin.zip file.
Unzip it. Here you get a library file, a header file and a dll file.

Put the .lib (library) file on your visual studio library folder. If you install visual studio on it's default location it will be C:\Program Files\Microsoft Visual Studio 9.0\VC\lib

At the same manner put the .h (header) in the include folder of your visual studio. It will be fine if you create a floder named 'GL' in the include folder and put the header file there. So the location like C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL

Put the .dll file on system32. Like C:\Windows\System32

Now you are ready for coding. Open your visual studio 2009. Go to the File->New->Project section. A new window comes select visual c++ -> General -> Empty Project.

Now go to the Solution Explorer. Right click on the project, select properties. From the Configuration tab select all configurations. Select Configuration properties -> Linker -> Input. Now on the left section copy "opengl32.lib glut32.lib glu32.lib" at additional dependencies. That's all.

Now Download the code

Reference and Additional Download:

1. This tutorial is prepared with help of this site.

Eooks Download Links

2. OpenGL SuperBible
3. OpenGL Programming Guide
4. OpenGL Graphics Through Application
5. Fundamentals of Computer Graphics
6. OpenGL Game Programming
7. OpenGL Game Programming -- Book Code
8. OpenGL API specification

Important Web Links

nehe.gamedev.net
lighthouse3d.com

I will try to post later how to install and configure OpenGL on Linux based platform.



0 comments: