GLfloat vs. float?

Started by
2 comments, last by colinisinhere 20 years, 11 months ago
what is the difference?
Advertisement
I believe the reasoning for using GLfloat is for platform/implementation independence. One implementation might use 64-bit floats, another might use 80-bit. Not sure tho.
float -> ''float''.
glfloat -> ''typedef float glfloat''.

Theres supposably some stuff about porting and how the glfloat is always guaranteed to be 32 bits but a float isn''t, but noone cares.
The GL spec guarantees a certain amount of precision or a certain range on the GL-types. It does not guarantee any specific size, only a minimum size. For example, GLfloat is guaranteed to be at least 32 bits long, but an implementation can choose to make it longer if, for example, there are no native 32 bit floatingpoint types available.

This topic is closed to new replies.

Advertisement