[HOpenGL] Re: GLUT documentation

Sven Panne Sven_Panne@BetaResearch.de
Wed, 19 Mar 2003 16:05:32 +0100


"C.Reinke" wrote:
> [...] Calling it HGlut,

Well, simply adding an "H" probably wouldn't convince a lawyer...

> [...] Last time I looked at the HOpenGL sources, they tended to state
> things like "this module implements pages xxx of the GLUT spec, with
> the following modifications"..

Things have changed drastically in the CVS version, you should be able
to build it easily when configuring GHC with --enable-hopengl. GLUT's
API is built heavily upon the OpenGL concept of a state variable, and
this is now reflected on the Haskell side. Have e.g. a look at the size
of the current window, it's type is now:

   windowSize :: StateVar Size

No different functions for getting it and setting it, just use:

   windowSize $= Size 400 300

and

   size <- get windowSize

State which can only be read has another type, e.g.:

    parentWindow :: GettableStateVar Window

You can do

    parent <- get parentWindow

but

    parentWindow $= <whatever>

will result in a type error. Similar things hold for write-only state.

In Marks's spirit, this is still exactly the GLUT API, but without the
restrictions of the C language. The docs are consequently quite different,
too, but are of course based on what I've read about GLUT's C API.

Frankly, I don't really care about the legal status of my docs anymore, and
will leave it in HOpenGL. If some distributions have a problem with this, so
be it... I've done the best I could do to clarify this and made no gratuitous
additions to GLUT (which is exactly what Mark tries to prohibit).

As an aside, I've got the permission to base my OpenGL docs on SGI's man
pages without any trouble. Things are sometimes easy...   :-]

Cheers,
   S.