[HOpenGL] HOpenGL without GLUT

Sven Panne Sven_Panne@BetaResearch.de
Mon, 24 Mar 2003 16:15:02 +0100


Axel Simon wrote:
> I thought about extending my gtk2hs with OpenGL functionality.

A good plan! :-)

> I know that you did some work for gtk+hs

I didn't do very much (only some testing), Manuel did the work for
the GtkGLArea binding.

> which had a special GtkGLArea widget which probably embedded a
> GLUT window.

No, there is no such thing as a GLUT window when GtkGLArea is used.
The widget simply takes care that the correct OpenGL context (a
thread-local entity) is in effect when OpenGL rendering starts.

> There is new functionality for Gtk version 2 which seems to just
> add 3D rendering to normal widgets:

Just to be clear: Neither GtkGLArea nor GtkGLExt offer any kind of
rendering capabilities, they offer the resource management for the
current OpenGL context (i.e. the OpenGL state machine(s)).

The rendering itself is done always the same way, regardless of the
Toolkit / resource management library in question (GTK, GLUT, WGL,
AGL, GLX).

> [...] As such, does that mean HOpenGL is of no use to me at all (in
> terms of code reuse)?

No, quite the contrary: You can just ignore the GLUT part and use all
of the GL/GLU part. The CVS version in the fptools repository has even
different packages ("OpenGL" and "GLUT", surprise! :-) for these.

Cheers,
   S.