[HOpenGL] ghc-6.0.1 and OpenGL enabled

Sven Panne Sven.Panne at informatik.uni-muenchen.de
Tue Oct 7 20:06:23 EDT 2003


Patrick Scheibe wrote:
> At this time the situation of HOpenGL and ghc --enable-hopenGl is very 
> confusing to me.

Sorry for the confusion. The current situation is as follows:

    * What you find on http://haskell.org/HOpenGL/ (versions 0.9 - 1.05) are
      basically snapshots from my private CVS repository. The API is more or
      less the same for all those versions. I do not intend to support these
      versions in the future, the work needed is simply too much.

    * The stuff in the fptools CVS repository and the source tar files and RPMs
      generated from it contain the new HOpenGL code base, offering a new API.
      It is under active development and almost finished, only NURBS and
      pixel-related things like texturing are missing. It should run on more
      platforms than the old stuff, including Linux, WinDoze, Mac OS X, OpenBSD,
      FreeBSD, and Solaris. Note that Hugs now uses the libraries from fptools,
      too, so the next Hugs release will have OpenGL/GLUT support, too.

The transition to the fptools repository was not made randomly, it was made
because I couldn't see a smooth transition: The new code doesn't require
GreenCard (it's pure Haskell98 + FFI) and the API is now centered around the
notion of state variables, just like the OpenGL/GLUT specs themselves.

> I tried to install the new HOpenGL package from Sven. But the make install 
> doesnt seem to work. When I tried to compile a simple example of the Redbook 
> the linker stops because of undefiened references to some c-functions.
> If theres some time I post the exact error-message ..

It would be nice to see the transcript of the session plus config.log and
config.status.

> [...] The push and popMatrix functions dont seem to be there in future.
> What should I use instead of this? [...]

As Wolfgang has already pointed out, using matrixExcursion is the way to go.
(BTW, I'm not very happy with this name, any suggestions are highly appreciated.)
This highlights one of the design decisions for the new API: GL calls which come
in pairs and are tightly coupled (like glBegin/glEnd, glNewList/glEndList,
glPush/glPop, ...) are only available through a higher-order function. This
ensures proper OpenGL operation, even in the presence of exceptions.

You get some documentation when you have Haddock installed and do a "make html",
but there is still a lot to be done. :-} Luckily, Sven Eric Panitz has written
a fine tutorial, which is not yet complete, but already quite usable and contains
*lots* of examples:

    http://www.tfh-berlin.de/~panitz/hopengl/

Apart from that, have a look at the examples in fptools/libraries/GLUT/examples.

Cheers,
    S.




More information about the HOpenGL mailing list