Working on other operating systems

The labs are performed on Ubuntu, a Linux dist. 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 differences between systems is small.

Ubuntu, CentOS

Ubuntu and CentOS are both Linux, which makes them so close to Mint that they are almost trivial to use. The makefiles should work unchanged or almost unchanged.

But you may need to install developer tools, mesa-dev and proper graphics drivers (not the “nouveau” drivers).

ThinLinc

NEWS! ThinLinc now works with OpenGL! (Or maybe not.)

The university provides ThinLinc as an easy way to make laborations from home. In the past, ThinLinc had practically no support for graphics! Running modern OpenGL over it was impossible according to the support.

This is the last I heard about the matter, but my own experiments shows that it does indeed work, with OpenGL3.3, which is just above our baseline!

Furthermore, it is possible to ssh to the lab computers. The -X option is supposed to map the window environment, which did not make any difference for me, but may still lower the load on the server.

PS: This seems to be a case of good luck. Later tests with ThinLinc did not work, but with ssh to the lab computers, it works, although with poor performance.

Windows

NEWS! My Windows support now switch to MinGW and CodeBlocks!

After major problems with Visual Studio, which I never liked anyway, and finding some rather irritating problems with DevC++, I have now switched all my coding on Windows to CodeBlocks. During fall 2021, I ran a course where the Windows support was vital, and this was a working solution.

Any other development system using MinGW should work.

See the course page for TNM084 for instructions on how to set up projects with CodeBlocks. It turned out to be fairly easy and most of my code works right out of the box with much less special fixes than Visual Studio needed.

CodeBlocks support has been tested with several demos.

Note: Some of you had problem making it work on Windows 10 or 11. I have tested on Windows 10 and it works just fine, so I am still looking for the source of the problem.

MacOS X

You need install Apple’s "Command line tools”, if you don’t already have them! You should use the command "xcode-select --install" in the Terminal.

Note: Recently (spring 2021), Apple seem to have broken this! The developer tools can still be downloaded manually, but only if you have a developer account.

https://developer.apple.com/download/more/?=command%20line%20tools

I hope this will go back to normal soon.

Granted that the command-line tools are in place, the version of the lab 1 files below include a makefile that works on my computer, hopefully also on yours:

lab1-mac-2.zip

Please note that you need the “common” folder as well.

More notes and details (hopefully not important with the makefile above):

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 for Mac is included in the lab package.

Changes: Frameworks: Replace -lGL (OpenGL) and the -lX directives (X-windows) with -framework OpenGL and -framework Cocoa.

There have been problem with the lab code under MacOSX 10.14. As of january 2019, a preliminary verison of he common files has been uploaded that fixe the problems as far as I have tested.

XCode seems to have ARC, automatic reference counting, turned on, and you need to turn that off. (Not tested yet.)

Finally, OpenGL is, sadly, now deprecated on MacOSX. You will want to turn off deprecation warnings.

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 interface 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. NEWS 2023: C++ is now rolled in as official alternative already in the labs, and new variants of some code, including VectorUtils, are in header-only format to make it fully portable between C and C++. Thus, C++ is no longer an “other languge” but moves in as part of the central part of the course.

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 projects, 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.

This page is maintained by Ingemar Ragnemalm