View Full Version : OpenGL tutorials for linux!

07-06-2006, 11:01 AM
Hey everyone!!! I am a research intern and I'm in the process of learning OpenGL. I have found alot of very useful tutorials, but almost all that I found are for use with Visual C++. This has been distressing since I tried to convert it to be used on Linux without much success :( I would greatly appreciate it if someone could inform me of a website or a book I can use to rectify this problem or a better way to convert the code to be compatible with Linux! Thanks alot and enjoy your day!!

PS I downloaded the code from NeHe's tutorial that was adapted for Linux but they added libraries that are not on my computer and that I haven been unable to find on the net. libraries such as:
#include <X11/extensions/xf86vmode.h>
#include <X11/keysym.h>

so although the code is compiling I am unable to close the window and it freezes the computer

07-06-2006, 11:21 AM
For starting OpenGL I would recommend using glut instead of writing the windowing routines yourself. You can always change that later, but for starting it's good enough.

Use the NeHe tutorial for Mac, it should work on Linux without modification. It may be that you need to install glut (or freeglut) on your box, but most distributions have it preinstalled.

07-06-2006, 11:54 AM
I agree that using glut to get started is much easier than writing code for the operating system. It will also make the applications that much easier to move around later.

If you take the Mac versions of nehe's tutorials the only changes you should have to make are when including the header files:
change <OpenGL/gl.h> to <GL/gl.h>
<OpenGL/glu.h> -> <GL/glu.h>
<GLUT/glut.h> -> <GL/glut.h>

also, obviously you won't be able to use the xcode project so just remember to link all the libraries when you compile.

check this (http://www.eecs.tufts.edu/~nfoti01/GLSLdemo-1.0.tar.gz) out if you want to, it is a small demo application
that I've had around that runs on linux. It depends on the GLEW library so you'd have to downlaod that if you wanted to try it.
However, it would show you an OpenGL application on linux.

07-06-2006, 12:06 PM
The Mac OS X Using GLUT lesson is a bit skinny, use either the gameglut port or theLinux/SDL one

As for lesson01, i am happy to report that both versions of the new lesson01 will be system independent(glut and SDL), we allready have (semi)working versions of both, we just need to add some l33tness to it. :)
But as for when it's released, that's anyones guess, it could be next week or next month, who knows.

Brian Paul
07-06-2006, 04:14 PM
The Mesa distribution includes quite a few example programs, both GLUT and GLX-based.

07-06-2006, 11:58 PM

these are simple single file sources and seem to be a good start.

Don't need any libraries apart from some which are part of X and OGL