[HOpenGL] Choice between old and new API

Sven Panne Sven.Panne at aedion.de
Sat Oct 2 17:06:28 EDT 2004


Yann Morvan wrote:
> I am doing research in computer graphics and have been using the
> old HOpenGL to try ideas.
> Recently I've wanted to use 2D convolution and discovered it wasn't
> supported in HOpenGL 1.5.
> I am a bit constrained by time (I have a Ph.D. to finish) and I wanted to
> know what would be the easiest between:
> -learning how to build the old HOpenGL 1.5 API and then adding the
>  bindings for the convolution functionnalities

This would be wasted effort IMHO...

> -or porting my existing code (which is around a few thousand lines) to
>  use the new most recent API, provided it supports texturing and
>  convolution

Sounds more promising... :-)

> Unfortunately I am developping under windows XP, using the cygwin
> environment. If I have to compile the latest version of the GHC
> distribution to get those functionnalities, I am worried that it may prove
> very time consuming. Assuming that this is not a problem, how different
> is the new API from the old one ? Will the changes I'll have to make to my
> old code be merely cosmetic or more in depth ?

As almost always, the answer is somewhere in between: The new API is much
more symmetric and centred around OpenGL's notion of state variables. If
you know OpenGL quite well (as you obviously do when you use rather uncommon
things like convolution), you should have no real problems switching to the
new API. Documentation for the bleeding edge stuff can be found at

    http://haskell.org/HOpenGL/newAPI/

and lots of examples are in the CVS HEAD, see

    http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/GLUT/examples/

Especially

    http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/libraries/GLUT/examples/RedBook/Convolution.hs?rev=1.2

might be of interest to you.

Building under Windoze should pose no real problems nowadays, but Mike is
doing some nightly builds, perhaps he can even provide you with a binary
snapshot. The "real thing", i.e. GHC 6.4 with full OpenGL 1.5 support, will
probably take 1-2 months until it is released. The soon-to-be-released
GHC 6.2.2 does offer the new API, but no convolution stuff.

Cheers,
    S.


More information about the HOpenGL mailing list