Working on other operating systems

The labs are performed on CentOS, that is a variant of Red Hat Linux. However, it is perfectly possible to use other operating systems. OpenGL runs on practically any device that has any kind of graphics output! This includes all Linuxes, MS Windows, Mac OS X, but also most smartphones, tablets, etc. In most cases, it is pretty easy to get OpenGL rolling, there are good examples available and the diffences between systems is small.

Ubuntu

Ubuntu is so close to CentOS that it is almost trivial to use. However, on recent Ubuntu installations, some necessary libraries are not automatically linked. Try adding -lX11 and -lm to your command-line. Here is a modified makefile that has been found to work (thanks to Rovanion Luckey for submitting it):

makefile

Windows

For Microsoft Windows users, we have a few possibilities. The most up-to-date code to work from at this time (2016) is the "psychedelic teapot" demo in the demo section (linked from top computer-graphics.se page).

We have also (earlier) prepared a Visual Studio project (by Umapathi Tallapragada, new version by Ingemar).

openGL3Example-vs.zip (New version, cleaned up to match the labs and including some installation instructions.)

You also need the GLEW library 1.5 and a fresh FreeGLUT. (See the instructions.) Note: FreeGLUT is no longer needed since MicroGlut now exists for Windows in a pretty usable version!

This example is pretty old by now, but I hope it can be of some help even if you have a newer version of VS. For now (2016) please start with the psychedelic teapot!

There are, of course, many other ways to develop under Microsoft Windows but I hope you understand that we can't support them all.

The general rules for Windows are that:

- MicroGlut doesn't exist (yet) for Windows, so you should use FreeGlut. Some convenient additions in MicroGlut will then be missing, but that is just a few calls.

- You need to use GLEW, the OpenGL Extrension Wrangler. This means including a library, an #include at the right place and a function call in the main program. Not too bad.

MacOS X

All labs and all demos were originally developed on Mac OS X so how can you go wrong? Well, one vital detail:

Don't use MicroGlut for Linux on the Mac!

On the Mac, you use the Mac version (MicroGlut.m). If you link with the Linux version (MicroGlut.c) you will get a ton of errors since it can't find X11.

MicroGlut home page

You need to use MacOSX 10.7 or up, with Xcode installed. You should also install "Command line tools"! (Preferences/Downloads in Xcode or separate download or by a command-line command.) But you already had this, right?

One more thing: On the Mac, you like OpenGL as a framework. So you don't link OpenGL with -lgl, but with -framework OpenGL. Cocoa also needs to be linked.

GLES

GLES, OpenGL for Embedded Systems, is what you find on your phone. It is a perfectly usable OpenGL, but with some differences. Expect some editing if you want to make the labs here.

WebGL

WebGL is OpenGL for web browsers. This limits you to JavaScript. Also, WebGL is a variant of GLES so the same differences apply.

Other languages

Apart from OpenGL's great portability to different platforms, it is also extremely portable between different programming languages! Just about any remotely useful language comes with an OpenGL interface!

Java: The OpenGL interfaces is called JOGL.

C++: C++ calls into OpenGL just like C does. All lab code has been prepared to be "C++ friendly", it has some #ifs to handle the interface between the languages. VectorUtils3 also includes C++ operator overloading.

Python: The Python OpenGL interfaces are called PyOpenGL.

(I could write about a dozen other languages here.)

You are allowed to use any platform and any language you like, especially for the porjects, but be warned: The farther away you go from what we have experience with, the more you are on your own to solve problems. We will help, but our help can get shallower on platforms that we are not familiar with. But I really love to see students "boldly go where noone has gone before". I just havn't been there myself.