Jump to content
  • Advertisement

Archived

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

giller

GLfloat vs. float

This topic is 6054 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

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!