Advertisement

float vs GLfloat

Started by January 26, 2001 11:20 AM
2 comments, last by Catfish 24 years ago
Heya...quick question for everyone: Whats the difference between straightforward variables & GLvariables? eg GLfloat, GLint, GLvoid etc... Are GLvariables stored on the gfx card for quick hardware access, or what? When should you use which? Cheers Catfish
Well no difference at all.
Im not sure why they are there but it seems to me that Everyone has to make their own definitions of the standard variable types.

if you ever code ODBC, you will learn that there are SQLuint SQLTCHAR and so on..
and windows has it to BOOL just to name one

this code is taken from the top of gl.h:

typedef unsigned int GLenum;typedef unsigned char GLboolean;typedef unsigned int GLbitfield;typedef signed char GLbyte;typedef short GLshort;typedef int GLint;typedef int GLsizei;typedef unsigned char GLubyte;typedef unsigned short GLushort;typedef unsigned int GLuint;typedef float GLfloat;typedef float GLclampf;typedef double GLdouble;typedef double GLclampd;typedef void GLvoid; 


so a GLfloat is really notin'' but a simple 32bit float :D
Jonas Meyer Rasmussenmeyer@diku.dk
Advertisement
typedef float GLfloat;
It''s at the top of the opengl header.
It was just meant for those who wanted to use it.
So basically you can just use either and get the same result.
All depends on witch you think it more pretty. :D
GL* types are for cross-plateform development. An int can be 16 or 32 bit long, depending on the OS. A GLint is ALWAYS 32 bit long, whatever your plateform is, which can be useful if you target several OS.

These GLstuff wasn''t created just for fun!

This topic is closed to new replies.

Advertisement