GLfloat vs. float
Can anyone explain the difference between GL variables and base variables.
Eg.
GLfloat vs float
GLvoid vs void
GLuint vs int
thanks,
..giller
My understanding is that the GL data types are used for cross platform compatablility.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
Take a look at how the types are defined in the header files.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
thier are jst the same, but when some reads your prog he/she can see that u used GL
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
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
[size="1"]
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.
I meant equivlent in terminology, not size ;¬)
Good point though!
Dan
Good point though!
Dan
[size="1"]
I use short or long most of the time in my code, that way you know for sure.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement