1 Aug 2009 16:16
Re: [Haskell] ANNOUNCE: OpenGL 2.3.0.0
Sven Panne <Sven.Panne <at> aedion.de>
2009-08-01 14:16:06 GMT
2009-08-01 14:16:06 GMT
[ Thread moved to HOpenGL mailing list ] Am Freitag, 31. Juli 2009 22:43:14 schrieb Paul L: > [...] > I've also noticed that the decision was made to use solely C types as > instances for VertexComponent, ColorComponent, etc. I'm not sure I > understand this change because: First of all I have to admit that I'm guilty of leaving out this change from the change notes, sorry for that. > 1. There was no default type for things like GL.Vertex3, and one had > to explicitly annotate the type. Removing Int, Float from the > Component classes would surely break A LOT OF existing code. Strictly speaking, it breaks only code which was wrong, anyway. The OpenGL spec itself makes e.g. only assumptions about minimum sizes of the types, but prescribes no specific mapping. Granted, GLfloat e.g. has been a type synonym for Float, but there was never a guarantee for that and I consider the usage of type synonyms for this an API bug in previous versions of my package. Fixing code which breaks is quite trivial and those fixes will make any non- portable assumptions explicit (via fromIntegral, realToFrac or castPtr), which is a good thing, and the way it should have always been. In your example above, the type annotation should be ':: GLfloat', not ':: Float', which worked only by accident. If you have a 'Vertex3 Float', use 'fmap realToFrac' to get a 'Vertex3 GLfloat'. > 2. I don't see a problem adding back Int, Float, Double, etc. as > instances of those Component classes along side of C types.(Continue reading)
> [1 of 1] Compiling Main ( SmoothOpenGL3.hs, SmoothOpenGL3.o )
> Linking SmoothOpenGL3 ...
> $ ./SmoothOpenGL3
> SmoothOpenGL3: user error (unknown GLUT call glutInitContextVersion,
> check for freeglut)
That's OK: To create an OpenGL 3.x context, you need a recent version of
freeglut. Classic GLUT and older versions of freeglut simply do not have the
API entries glutInitContextVersion and glutInitContextFlags. I really, really
hope that the freeglut project admins make a release soon. I am active in this
project, but I can't make releases. There are a few GL/GLX extensions I'd like
to add to freeglut, too, but only after a release.
Depending on your OpenGL driver, you can make things work by using
RSS Feed