views:

203

answers:

5

I'm looking for a good Ubuntu OpenGL tutorial for a friend who already knows how to use OpenGL in Windows. Can anyone recommend any?

+1  A: 

there is not much to know, just how to compile.

install mesa lib, and add the appropriate(s) flags to gcc, such as -lGL -lGLU.

I can't find my bookmarks on the subject, but he can easily find how to compile, and all the rest should be just the same.

Aif
Really? It's just compiling? I thought that window creation was different as well.
snostorm
It is - as Juliano says, the GLUT library can handle creating the window in the same way between platforms.Assuming this is games-related, and games typically have more than just graphics, you could also look at SDL as a cross-platform layer for handling OpenGL, sound and input. Other cross-platform frameworks are available.
Nick
+3  A: 

OpenGL is the same in Linux, Windows and MacOSX, the difference is the windowing system. If you just want to get quickly into building multi-platform OpenGL applications, take a look at GLUT (open-source alternatives, Ubuntu comes with freeglut). GLUT is source-compatible between operating systems, so you can compile the same code, without modifications (theoretically), in Windows and Linux.

If you need something more elaborate, you should start using either GTK+ or Qt to build your application GUI. GTK+ has a GtkGLExt extension that creates a widget that contains a OpenGL context you can draw. Qt comes with the QtOpenGL module, which provides the QGLWidget widget.

Juliano
SDL is also a good choice...
Spudd86
A: 

look here: http://nehe.gamedev.net/lesson.asp?index=01

great tutorials!

EDIT: look here too nehe.gamedev.net/data/lessons/lesson.asp?lesson=02 You can download the linux-source code at the bottom of the page.

pixar
Nehe tutorials are not very good (when you have access to the red book: http://www.glprogramming.com/red/ ), and they are Windows-based.
Juliano
A: 

There are a few tutorials here which might be helpful: http://www.opengl.org/wiki/Getting_started#Tutorials_and_How_To_Guides

James
+1  A: 

hm, if your friend is familiar with opengl in windows, one solution could be to get him 'used' with cross-platform libraries, first in windows environment..

Make him download one of the frameworks (sdl,qt,glfw,glut.. etc. there are plenty these around (id recommend http://www.glfw.org/ , really easy and good framework with enough documentation in pdf format)) and port his old 'windows only code' to use the chosen library. After he is comfortable with the framework, switching to another platform will be less painful.

Akin