Quick and easy question (i hope)
Hi,
I was wondering why the openGL headers define the types GLfloat, GLint etc. These types are just floats and ints, aren''t they? So, what''s the point in using GLfloat instead of float?
Thanks,
Dave
It is kind of insurance of portability. Let''s say that the OpenGL library requires a number with a range of 0-255 (unsigned char normally, or GLubyte). If a certain system uses 16bits for a character, then OpenGL must not use a character, and must use some other data type. So, but changing a single line in a header, they just made OpenGL portable to that new system/language/whatever .
"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said
http://druidgames.cjb.net/
"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said
http://druidgames.cjb.net/
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement