View Full Version : Should you use double or GLdouble?
03-16-2001, 11:50 AM
when coding opengl programs using mfc should u use GL'type' or int float bool or double etc?does it make a difference?
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.
03-18-2001, 11:02 AM
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
What are platforms where float is 64 bit??
[This message has been edited by Randolph (edited 03-18-2001).]
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?
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.