Advertisement

Quick and easy question (i hope)

Started by April 15, 2001 04:02 PM
0 comments, last by DaveG 23 years, 7 months ago
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
Resist Windows XP''s Invasive Production Activation Technology!
http://druidgames.cjb.net/

This topic is closed to new replies.

Advertisement