Archived

This topic is now archived and is closed to further replies.

GLfloat vs. float?

This topic is 5339 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites