On 25 May 2011 21:04, Joel Shellman <joel@...> wrote:
> What would it take to get full support for OpenGL in wxHaskell? My
> understanding is that wxWidgets supports it, we just need the Haskell
> binding for it, right? And I think it used to be there in a previous
> version of wxHaskell.
Putting support for OpenGL canvas into wxHaskell is very straightforward. I
could do the code in about an hour.
The problem is to make wxHaskell compile and link successfully on all
supported platforms with as little user intervention as possible (basically,
I want anyone with wxWidgets to be able to 'cabal install wx' and everything
The first problem is that wxWidgets may or may not be built with OpenGL
support on any given platform, and wxDirect, which does much of the code
generation, doesn't support conditional compilation.
*Question for the general user community of wxHaskell - is the addition of
an OpenGL target dependency OK with you?* (apologies for shouting, but I
don't want this to be missed by speed readers!)
The impact is mostly to Windows users, since Windows wxWidgets builds don't
support OpenGL by default (it's only a case of adding wxUSE_GLCANVAS in
setup.h and adding USE_OPENGL=1 on the build command line), but there may be
Linux distros which don't build their wx packages with OpenGL - I don't
The second problem is that wxWidgets only gives you a canvas, so we would
need to make sure that wxHaskell plays nicely with a Haskell OpenGL binding.
I don't have time to do this.
Joel, I have a proposal for you: if I put support for wxGLCanvas and
wxGLContext into a branch in the wxHaskell repo (when it gets restored), I
need evidence that it is usable on all of the supported wxHaskell targets
(i.e. Linux/Gtk, Windows, Mac) - that means working out the dependencies,
how to build and ensuring that there is a working sample application. Are
you able to co-ordinate this activity?
If you (or anyone else) can do this, my side of the bargain is that I'll
mainline OpenGL support in wxHaskell and ensure that all of the
documentation is updated to reflect whatever is needed, blog on how to use
it and generally make sure that there is information out there on which
everyone can rely.