float/double vs GLfloat/double
is there any reason to expect GLfloat/double ever being different from float and double.
like: when working with gl should i always use GL types for performance? is there a compatibility issue also?
like: when working with gl should i always use GL types for performance? is there a compatibility issue also?
I would recommend that you use GLfloat/GLdouble for any value that you will be passing to an OpenGL function. That way, if you ever port the application to another OS, you wont have to worry about it.
If you have a class/object that does not include any OpenGL headers, then just stick with float/double rather than including the headers just so that you can use GLfloat/GLdouble.
If you have a class/object that does not include any OpenGL headers, then just stick with float/double rather than including the headers just so that you can use GLfloat/GLdouble.
As I understand it, the advantage of GLtypes over the normal versions is that your code may be more portable. From the Redbook:
[edit - eh, too late]
Quote:Note: Implementations of OpenGL have leeway in selecting which C data type to use to represent OpenGL data types. If you resolutely use the OpenGL defined data types throughout your application, you will avoid mismatched types when porting your code between different implementations.
[edit - eh, too late]
Using float and double rather than GLfloat and GLdouble is usually going to be OK. Although there's a possibility that on some future or past platform GLfloat might be a typedef of double and GLdouble might be a typedef of long double, I haven't seen that yet...
For the integer types, it's much more important that you use the appropriate typedef, as it does differ platform-to-platform whether the types like GLint, GLsizei are typedef'd from int, long, long long, &c.
For the integer types, it's much more important that you use the appropriate typedef, as it does differ platform-to-platform whether the types like GLint, GLsizei are typedef'd from int, long, long long, &c.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| float FBO on iPhone (invalid operation error) | Fenris | 11 | 2,713 |
Jan 17, 2013 05:40 AM Last Post: Fenris |
|
| iPhone/iPad Audio Glitch - Double Hiss/Static | reapz | 2 | 4,259 |
Dec 8, 2010 06:22 PM Last Post: reapz |
|
| Best way to readback float pixels? | kelvin | 8 | 4,108 |
Feb 27, 2008 10:23 PM Last Post: kelvin |
|
| convert NSArray in float[] | bonanza | 6 | 4,844 |
Jun 25, 2007 10:33 AM Last Post: TomorrowPlusX |
|
| Double-Buffering with NSOpenGLView | DesertPenguin | 3 | 4,788 |
Aug 1, 2006 07:17 AM Last Post: DesertPenguin |
|

