View Full Version : Glfloat etc...
02-21-2001, 08:08 PM
could the declaration
static GLfloat vdata  ...
be ionterchangeable with the c++ command
static float vdata ...?
or GLuint interchangeable with int?
GLfloat is the same as float.
GLuint is the same as unsigned int.
Check the gl.h header file, all the GL data types are typedef'd near the top of it.
well, not always.
sizeof(GLfloat) != sizeof(float) forall architectures
GLfloat is GUARANTEED to be 32 bits wide, because the opengl arb say it WILL be, and Lo, it is so.
but, all the C/C++ specification says is that
sizeof(char)<=sizeof(short int)<=sizeof(long int)
(or, something to that effect), so that... char isn't ALWAYS 8 bits on ALL machines (some have 16bit characters), floats aren't always 32 bits (some are 64, or even 80bits...). it depends.
so, the answer is: no, it isn't interchangeable, but you can probably get away with it. perhaps.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.