Re: [Haskell-cafe] Opengl and Haskell GLdouble/GLfloat vs. Double/Float

2007-09-28 Thread Jules Bean

bbrown wrote:
I am going to be doing a lot of opengl stuff in haskell and so far one thing 
has irked me.  Why does haskell keep the GLFloat and GL types and not just 
the Haskell types.  


It mirrors the C API in doing so.

I assume that this is because, in principle a system might exist where 
the graphics card (and hence, openGL library) used different-precision 
numbers to the CPU.  Perhaps 32bit card on a 64bit machine gives you 
32bit GLints even though you have 64 bit ints?


I don't know how often (if ever) this happens in practice.

Certainly GLfloat, GLdouble, GLint are members of all the type classes 
you would hope them to be and they are no less convenient to use.


Jules
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Opengl and Haskell GLdouble/GLfloat vs. Double/Float

2007-09-28 Thread Bas van Dijk
On 9/28/07, Jules Bean [EMAIL PROTECTED] wrote:
 Certainly GLfloat, GLdouble, GLint are members of all the type classes
 you would hope them to be and they are no less convenient to use.

And so, if you need it, you can always coerce between the GL and the
standard Haskell types by using the general coercion functions:
'fromIntegral' and 'realToFrac'.

Bas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Opengl and Haskell GLdouble/GLfloat vs. Double/Float

2007-09-27 Thread bbrown
I am going to be doing a lot of opengl stuff in haskell and so far one thing 
has irked me.  Why does haskell keep the GLFloat and GL types and not just 
the Haskell types.  

--
Berlin Brown
[berlin dot brown at gmail dot com]
http://botspiritcompany.com/botlist/?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe