Archived

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

giller

GLfloat vs. float

Recommended Posts

Can anyone explain the difference between GL variables and base variables. Eg. GLfloat vs float GLvoid vs void GLuint vs int thanks, ..giller

Share this post


Link to post
Share on other sites
To expand on what Eber Kain said:

Different development environments use different sizes for the base types. As OpenGL is cross platform and is usable in many different programming languages, it is useful to ensure that its all using the same size types, so GL defines its own.

The only time conversion between noraml and GL types would be a problem is if you need to be sure you are maintaining the same level of accuracy.

BTW GLuint is NOT equivalent to int - its equivalent to unsigned int.

Dan

Share this post


Link to post
Share on other sites
A GLuint is not necessarily equivalent to an unsigned int. OpenGL requires a GLuint to be an unsigned integer that is at least 32 bits long. In the (not so) old days, when a regular integer was 16 bit long (on some platforms), an unsigned int did not meet the requrements for the GLuint datatype. Today, this is a lesser problem though.

Share this post


Link to post
Share on other sites