OpenGL/GLUT examples crashing: known problem?

Claus Reinke claus.reinke at
Fri Apr 8 19:37:04 EDT 2005

[cc-ed to hopengl list, probably more suited for follow-ups?]

Hi Tim,

not sure whether this helps, but I just compiled and ran the redbook
examples here (win98se, ghc6.4), and all but 2 looked well-behaved.

As for parameters, "fgrep -w args *hs" shows that the only programs
that admit to inspecting their parameters have a sensible default. More
interesting are the interactions, as far as they go beyond <esc> for
exit - check the keyboard functions in the sources to get an idea.

Btw, you probably shouldn't redirect the (error-)output to /dev/null
if you want to know what goes wrong;-) On my ancient configuration,
several examples report unknown OpenGL calls or missing extensions.

In fact all but one of those programs which "fail" on my system (9, not
the same as in your list, but for MVArray and Quadric) give me such 
explanations (the one exception was Quadric, with which I couldn't 
see anything wrong on the screen, and which does in fact give me 
an "ok" when run again on its own..).


Two of the examples crashed on me:-( Tess.hs & TessWind.hs. As 
if that wasn't bad enough, I had to remove them from the test loop 
because they don't leave my opengl system in a good state: no
obvious havoc outside the examples, but if I ran the test loop a 
second time, many examples only showed a black screen, or 
missing features.

Never mind whether or not they should work, but what about the
crash? Is that just a case of bad programming, or something that 
the library should catch, or a safety hole, or something wrong 
with my setup?

-- ??
Prelude Graphics.Rendering.OpenGL.GL> get glVersion >>= print

Prelude Graphics.Rendering.OpenGL> get gluVersion >>= print
" Microsoft Corporation"

Prelude Graphics.UI.GLUT> get glutVersion >>= print
"GLUT 3.7"

Btw, is there a way to reset the opengl system to a sane state in 
software? Or are there some invalid assumptions about default 
state in the other examples?


----- Original Message ----- 
From: "Tim Smith" <tim at>
To: <glasgow-haskell-users at>
Sent: Thursday, April 07, 2005 12:44 AM
Subject: OpenGL/GLUT examples crashing: known problem?

> Hi!  I just got GLUT to compile with a recent GHC (tried both ghc6.4 and
> a fresh CVS), see:
> Anyways, now I did 'gmake' in GLUT/examples.  Everything builds fine,
> but a number of the examples don't work.  I.e., in RedBook:
> 2:39 ~/local/src/build/libraries/GLUT/examples/RedBook$ for f in `find . -type f
> -perm 755 -print`; do if $f >/dev/null 2>&1; then echo "$f OK"; else echo "$f
> failed"; fi; done
> ./Alpha OK
> ./BezCurve OK  
> ./BezMesh failed
> ./BezSurf OK
> ./BlendEqn OK
> ./Checker OK  
> ./Clip failed
> ./ColorMat failed
> ./ColorMatrix OK
> ./ColorTable OK
> ./Combiner OK   
> ./Convolution OK
> ./Cube OK
> ./CubeMap failed
> ./DList OK
> ./Double OK
> ./DrawF OK
> ./Feedback OK
> ./Fog failed  
> ./FogCoord OK
> ./Font OK
> ./Hello OK
> ./Histogram OK
> ./Image OK
> ./Light failed
> ./Lines OK
> ./MVArray failed
> ./Material failed
> ./Minmax OK
> ./Mipmap OK
> ./Model OK
> ./MoveLight failed
> ./MultiTex OK
> ./PickDepth OK
> ./PickSquare OK
> ./Planet failed
> ./Polys OK
> ./Quadric failed
> ./Robot OK
> ./Scene failed
> ./Select OK
> ./ShadowMap failed
> ./Smooth OK
> ./SurfPoints OK
> ./Surface failed
> ./Teapots failed
> ./Tess OK
> ./TexBind OK
> ./TessWind OK
> ./TexGen failed
> ./TexProx OK
> ./TexSub OK
> ./Texture3D OK
> ./TextureSurf OK
> ./Trim failed
> ./UnProject OK
> ./VArray OK
> ./Wrap OK
> This is probably some known bug, but I wanted to check.  If so, does
> anyone know what the parameters are on what can be used, and what will
> core dump?  If it's not a known bug, I'll file a bug report - any other
> info that would be helpful?
> Thank you!
> Tim
> -- 
> If you're not part of the solution, you're part of the precipitate.
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at

More information about the Glasgow-haskell-users mailing list