[Haskell-cafe] OpenGL and GLUT in GHC

Ruben Zilibowitz r.zilibowitz at student.unsw.edu.au
Sat Mar 24 08:37:26 EDT 2007


I'm experimenting using OpenGL and GLUT in Haskell using GHC. There  
are modules Graphics.Rendering.OpenGL and Graphics.UI.GLUT. I am  
using these.

I've encountered a strange bug which I'm having trouble with. If I  
render a sphere and a plane, then the plane is facing the wrong way  
and is shaded on the wrong side. If however I only render the plane  
then it appears to be facing the right way and is shaded on the  
correct side.

I have made the source file available as a download here:

It can be built by running: ghc --make test.hs
I am using ghc 6.6

There is a comment in the source file saying: "Commenting out the  
line below here causes the plane to be rendered facing towards the  
The bug can be seen by commenting out the line of code that follows  
and recompiling.

If anyone can help me by explaining why I am getting this bug or how  
to fix it that would be great. I'd be very appreciative.



More information about the Haskell-Cafe mailing list