
Heh. interestingly enough, I didn't remember needing the glFlush()
call in Windows platforms (where I had used glut before), but now I
think I recall reading something about that. With flush :: IO() it
works. Sorry to bother you all with stupid things.
Maybe the HOpenGL tutorial should include flush in the calls, then. I
forgot that GLUT defaults to single-buffered.. My bad.
Thanks all,
-carlos
On Fri, 25 Jun 2004 08:55:27 +0200, Sven Panne
Carlos Scheidegger wrote:
[...] What happens is that the window seems to be created ok (at least I get a window entitled "APolygon"), but the contents of the window are just plain white. It should be to a red background, and a white polygon should be drawn.. [...]
I guess this is not Mac-specific at all: You don't use initialDisplayMode, so a single buffered window will be created by default. But you are using swapBuffers in your display callback, which is for double buffered windows. I'm not sure what exactly happens on Mac OS X then, but it is not correct on any platform. Two easy fixes: You can either request a double buffered window via "initializeDisplayMode [ ..., DoubleBuffered, ... ]" (before you create the window, of course), or you can use flush instead of swapBuffers.
Cheers, S.