From 11fa315fb1f68ea928cb1e0f692c4563904004a3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 5 Nov 2009 09:28:10 +0000 Subject: [PATCH] Added APIENTRY into glColor*/glNormal* calls and specialized the calls to just GLES1 --- src/osg/ArrayDispatchers.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/osg/ArrayDispatchers.cpp b/src/osg/ArrayDispatchers.cpp index 278c1af20..523833448 100644 --- a/src/osg/ArrayDispatchers.cpp +++ b/src/osg/ArrayDispatchers.cpp @@ -21,16 +21,18 @@ namespace osg { -inline void glColor4ubv(const GLubyte* c) { glColor4ub(c[0], c[1], c[2], c[3]); } -inline void glColor3fv(const GLfloat* c) { glColor4f(c[0], c[1], c[2], 1.0f); } -inline void glColor4fv(const GLfloat* c) { glColor4f(c[0], c[1], c[2], c[3]); } -inline void glColor3dv(const GLdouble* c) { glColor4f(c[0], c[1], c[2], 1.0f); } -inline void glColor4dv(const GLdouble* c) { glColor4f(c[0], c[1], c[2], c[3]); } +#if defined(OSG_GLES1_AVAILABLE) +inline void APIENTRY glColor4ubv(const GLubyte* c) { glColor4ub(c[0], c[1], c[2], c[3]); } +inline void APIENTRY glColor3fv(const GLfloat* c) { glColor4f(c[0], c[1], c[2], 1.0f); } +inline void APIENTRY glColor4fv(const GLfloat* c) { glColor4f(c[0], c[1], c[2], c[3]); } +inline void APIENTRY glColor3dv(const GLdouble* c) { glColor4f(c[0], c[1], c[2], 1.0f); } +inline void APIENTRY glColor4dv(const GLdouble* c) { glColor4f(c[0], c[1], c[2], c[3]); } -inline void glNormal3bv(const GLbyte* n) { const float div = 1.0f/128.0f; glNormal3f(float(n[0])*div, float(n[1])*div, float(n[3])*div); } -inline void glNormal3sv(const GLshort* n) { const float div = 1.0f/32768.0f; glNormal3f(float(n[0])*div, float(n[1])*div, float(n[3])*div); } -inline void glNormal3fv(const GLfloat* n) { glNormal3f(n[0], n[1], n[3]); } -inline void glNormal3dv(const GLdouble* n) { glNormal3f(n[0], n[1], n[3]); } +inline void APIENTRY glNormal3bv(const GLbyte* n) { const float div = 1.0f/128.0f; glNormal3f(float(n[0])*div, float(n[1])*div, float(n[3])*div); } +inline void APIENTRY glNormal3sv(const GLshort* n) { const float div = 1.0f/32768.0f; glNormal3f(float(n[0])*div, float(n[1])*div, float(n[3])*div); } +inline void APIENTRY glNormal3fv(const GLfloat* n) { glNormal3f(n[0], n[1], n[3]); } +inline void APIENTRY glNormal3dv(const GLdouble* n) { glNormal3f(n[0], n[1], n[3]); } +#endif template class TemplateAttributeDispatch : public AttributeDispatch