The OpenGL Resource Page

Compiling Instructions

  1. For Linux -
    1. The command line is
      gcc foobar.c -lglut -lGLU -lGL -o foobar
    2. Sometimes it may require the -lX11 -lXi and -lXmu libraries which will require you to add -L/usr/X11R6/lib to the command line too in addtion to the libraries.
  2. For Windows -
    1. Add the GL libraries to your linker path.
    2. Make sure you have the GL DLL's in your system directory.
    3. Build your project and it should work alright.
Checkout the Makefile in colorcube.tgz for further clarifications.

Some Tips

  1. OpenGL was meant to be platform independent - try to keep your code that way !!!
  2. Try and use GLUT wherever possible - it makes your code more portable.
  3. If you want to program specifically for X or for Windows - use GLX for X and WGL for Windows - GLUT does this for you so you are anyway better off sticking to what I said earlier.
  4. If you want to get fancy about userinput devices, networked stuff and sound explore the host of opensource libraries which are available to do the stuff. A very good thing to use here is SDL (Simple Directmedia Layer) - it is also supposed to be platform independent.
  5. Don't be disheartened if you happen to see a totally black window (nothing drawn) first time you run your GL code - it happens to everyone !!


  1. ColorCube - A simple colored cube viewer
  2. Atlantis - The atlantis screensaver from linux (the one with the dolphins). A classic glut demo by Mark J Kilgard.


  1. The OpenGL Viewing Pipeline [ps] [pdf]


  1. Opengl Official Site
  2. NeHe Productions (OpenGL) - Very useful OGL tutorials
  3. The OpenGL Red Book - The OpenGL programming guide
  4. The OpenGL FAQ and Troubleshooting Guide
  5. SDL Official Site

A Request To All Users

The various demos on this page are from various sources. Generally the source code of each program has the some information about its origin . If you use any of these source codes for your purposes do acknowledge the original source.
OpenGl is a registered trademark of SGI.

Page last updated on 09 February, 2004. pialpharhoalphagammaAT © Parag Chaudhuri , 2009
DCSE, IIT Delhi Valid HTML 4.0! Valid CSS! yahoo