
30 Sep
2009
30 Sep
'09
10:58 a.m.
If you are *really* sure that the runtime representation is the same you could use usafeCoerce. You could use a small test function for profiling, something like: convertGLfloat :: GLfloat -> Float convertGLFloat = realToFrac -- convertGLFloat = unsafeCoerce and toggle between the two (assuming you won't get a segmentation fault). Another option is to not convert at all but use the GL types everywhere. Either explicitly or by exploiting polymorphism.