I’m giving option to compile the program with either float or double type, but there is a problem: I need to manually set either GL_FLOAT or GL_DOUBLE, because I dont know how can I do the following:
typedef float MYTYPE;
#if MYTYPE == float
#define GL_MYTYPE GL_FLOAT // used for vertex array parameters.
#else
#define GL_MYTYPE GL_DOUBLE
#endif
Note: I dont have C++11 or whatsoever, just the good old C++.
You can do it this way:
You would need to define
MYFLOATif you want to usefloat, or omit it to usedouble.PS: keep in ind this is not evaluated at compile time, but at pre-processing time.