PDA

View Full Version : Should you use double or GLdouble?



Fyp2001
03-16-2001, 12:50 PM
when coding opengl programs using mfc should u use GL'type' or int float bool or double etc?does it make a difference?

Bob
03-17-2001, 03:57 AM
Usually it doesn't make much difference. A GLfloat is identical to a float on most platforms. GLfloat is just for portability. GLfloat is guarateed to give you a 32-bit floatingpoint representation, even though a standard float is something else, for example 64-bit. Same goes for all other types. On some 64-bit platforms an int, for example, is 64-bit long. But a GLint is guarateed to always be 32-bit.

Randolph
03-18-2001, 12:02 PM
Actually, I dont understand, why they do such things. I dont think that it will be time when GLdouble will not be double. Sometimes, it seems me even stupid. Same as, for example
#define ULTRAFASTCALL __fastcall
http://www.opengl.org/discussion_boards/ubb/biggrin.gif
What are platforms where float is 64 bit??

[This message has been edited by Randolph (edited 03-18-2001).]

Bob
03-19-2001, 02:18 AM
Some high-end computers (you know, $10k an up http://www.opengl.org/discussion_boards/ubb/smile.gif ) uses 64-bit architecture. Not that I know if they use 64-bit floats, but I won't be surprised if they do.

The reason is called compatability. Consider you have a file containing an object. Each vertex of the object is 3 32-bit floats. If you try to load that object on a platform where float is 64-bit, you are doomed. If you instead read them as GLfloat, you will read them as 32-bit float. Is that stupid?