I have frequently felt that cross-platform code is a very useful thing. In Computer Graphics, this becomes even more difficult to maintain, however, because everything needs to be written in C/C++. Windowing and UI calls are different under Windows, Linux or Macintosh. However, some kindly people have created a number of useful UI toolkits where they handle the OS calls, and give a precise set of classes or functions which you can call on any operating system to get a new window or button, etc.

As I recently taught a Computer Graphics course, I prepared example codes which create a basic OpenGL environment using a number of these different toolkits. As there are a few differences among platforms even with these toolkits, you can find the instructions for each below. So, feel free to follow the links below and attempt to use these platforms.

I would like to recommend the following page for those who are beginning in OpenGL programming: nehe.gamedev.net as an excellent source for tutorials for OpenGL.

The Linux versions have been compiled with gcc under Red Hat Linux 9.x.
The Windows versions were compiled under MSVC6 and have the associated .dsp/.dsw files. Enjoy!

Toolkit OpenGL - Linux OpenGL - Windows nVIDIA’s Cg - Linux nVIDIA’s Cg - Windows
FLTK fltkbasicgl.tar.gz fltkbasicgl.zip fltkbasiccg.tar.gz fltkbasiccg.zip
QT qtbasicgl.tar.gz      
GLUT   basicGLUT.zip