2011-05-15

Hello Blawg!

This is my first blog post evar, so be gentle :)

I'm tasked to rewrite the haskell package OpenGL this summer. The main task is to move it towards shaders and removing all the functionality that dissapeared with OpenGL 3.1. As it stands now the library on hackage is mostly undocumented and way too big. The library should shrink considerably in size when the project is over. You will also be able to use matrices as shader variables (yay! finally!). I don't know yet which version of OpenGL to depend upon. From what i can gather so far it seems like 2.1 + extensions or 3.2 are the best choices.

In my proposal I mentioned the creation of a library OpenGLRaw-Nice, which would be like OpenGLRaw, but more easy to use (there are some really nasty type signatures in OpenGLRaw). I know this could be useful for a variety of purposes (i.e. learning OpenGL in haskell using a C tutorial or writing your own bindings like fieldtrip or gpipe). If this is going to be done is the subject to community discussion. Work on this won't start until I've had a proper look at OpenGLRaw.

Once work is done with the Raw bindings the work on the main library will commence. There is a lot of code that will stay, but I figure a lot might need rewriting for whatever ideas for the bindings that eventually is decided on. One of my main goals with the project as a whole is to have proper documentation within the library. What exists now is that each sub-module has "look at chapter X.Y in the red book". I remember this not being very helpful when i first used the library. Another main goal is that the library should be usable by haskell beginners. Anyone who finished this course and has a linear algebra book should be able to use the library. This means that there probably won't be any type families or numeric types (exposed at least!). If you're into that stuff you can lobby for me to make OpenGLRaw-Nice so that you more easily can make those bindings yourself ;)
Another thing that i need input on is what to do about deprecation. I see two ways of doing this. The first is to create a sub-tree within OpenGL for deprecated modules (Graphics.Rendering.OpenGL.Deprecated). This will probably require a lot of work as I need to check all existing functions. The second way would be to say "fuck it!" and just remove everything. If anyone depends on old functionality they can always change their .cabal files to "OpenGL < 3" (this would of course be announced at least a month before happening, giving maintainers plenty of time to do this).
With GL 3.X the whole matrix stack dissapeared. Effectively OpenGL is no longer is providing any matrices for the users. So as a convenience for users a matrix and quaternion library will have to be built. So far i've looked at hmatrix, which seems promising.


tl;dr:
OpenGL needs rewriting. Problems:
Depend on 2.1 or 3.2?
Write a haskell-y wrapper for OpenGLRaw?
Have a deprecation model or tell people to update their .cabal files?
How to make a GLU-replacement?