diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 83b809713..6a75383b8 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -137,7 +137,7 @@ IF(DYNAMIC_OPENSCENEGRAPH) ADD_SUBDIRECTORY(osgwidgettable) ADD_SUBDIRECTORY(osgwidgetwindow) -IF(NOT OSG_GLES2_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE) +IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE) ADD_SUBDIRECTORY(osgscreencapture) ADD_SUBDIRECTORY(osgmotionblur) ADD_SUBDIRECTORY(osgteapot) diff --git a/include/osg/GL b/include/osg/GL index 0b1f0d251..e9ef4c7f7 100644 --- a/include/osg/GL +++ b/include/osg/GL @@ -15,6 +15,7 @@ #define OSG_GL 1 #include +#include #ifndef WIN32 @@ -161,17 +162,4 @@ #define GL_LUMINANCE_ALPHA 0x190A #endif -#ifdef OSG_GLES1_AVAILABLE - 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]); } - - 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]); } -#endif - #endif // __osgGL_h diff --git a/src/osg/ArrayDispatchers.cpp b/src/osg/ArrayDispatchers.cpp index 4a01d45b8..278c1af20 100644 --- a/src/osg/ArrayDispatchers.cpp +++ b/src/osg/ArrayDispatchers.cpp @@ -17,9 +17,21 @@ #include #include + 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]); } + +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]); } + template class TemplateAttributeDispatch : public AttributeDispatch {