1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| template<class T>
struct gl_trait ;
template<>
struct gl_trait<float> {
static inline glVertex (internal x, internal y, internal z) const { glVertex3f(x, y, z); }
static inline glNormal (internal x, internal y, internal z) const { glNormal3f(x, y, z); }
static inline glTexCoord(internal x, internal y, internal z) const { glTexCoord3f(x, y, z); }
};
template<>
struct gl_trait<double> {
static inline glVertex (internal x, internal y, internal z) const { glVertex3d(x, y, z); }
static inline glNormal (internal x, internal y, internal z) const { glNormal3d(x, y, z); }
static inline glTexCoord(internal x, internal y, internal z) const { glTexCoord3d(x, y, z); }
}; |
Partager