Sunday 24 November 2013

OpenGL for Dummies #1:Introduction

What is OpenGL?

OpenGL is an Application Programming Interface (API) for  rendering 2D and 3D computer graphics using simple primitives like points, lines, polygons, triangles, images and bitmaps.

Setting up OpenGL Environment on Windows 7

OpenGL more or less comes with the system. However, you will need to ensure that you have downloaded and installed a recent driver for your graphics hardware. You can find the updated driver and more details here.
Now we know that our operating system with updated graphics hardware drivers has the openGL API that we what to use. But we are not sure of the openGL version installed on the system. Next section will help you in finding out the OpenGL version currently present on your system.

Finding OpenGL version installed on your System?

To know about the OpenGL version installex on the system, we need GLEW (OpenGL Extension Wrangler Library). GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform. Follow the below steps to get started with GLEW:



  • Download the zip file and extract it.
  • Copy the glew-x.xx.xx folder to "C:\GL" (if not present create GL folder in C:\ drive).
  • Go to "C:\GL\glew-x.xx.x\bin\Release\Win32" path
  • Run "glewinfo.exe"
  • New "glewinfo.txt" file will be created which contains all the information about  supported OpenGL features, commands and different versions installed on your machine.

Now we know the version of openGl. But this is not enough to render the graphics on to the screen. We need utility toolkit to handle the window operations, keyboard operations. Next section will describe installation of Graphic Library Utility Toolkit (GLUT) on your system.

Installing GLUT (freeglut)



  • Download recent version of freeglut.
  • Extract the zip file and copy "freeglut-x.x.x" folder to "C:\GL".
  • Open "C:\GL\freeglut-x.x.x\VisualStudio\2010\freeglut.sln"\ in Visual Studio 2010
  • Rebuild the project.

  • The built libraries and dlls can be found at "C:\GL\freeglut-2.8.1\lib\x86\Debug" (we require these binaries for creating our own OpenGL projects) 

We are all set to run OpenGL programs. We will write our first graphics program in the next tutorial.

Happy Coding.. :)


0 comments:

Post a Comment