Moved glColor/glNormal definitions for GLES1.x from include/osg/GL to src/osg/ArrayDispatchers.cpp to avoid import/export issues on functions.

Fixed typo of GLES1 in disabling the build of OpenGL1.x/2.x specific examples
This commit is contained in:
Robert Osfield 2009-11-04 17:26:59 +00:00
parent 90d3c710c4
commit d7d6d2b215
3 changed files with 14 additions and 14 deletions

View File

@ -137,7 +137,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgwidgettable) ADD_SUBDIRECTORY(osgwidgettable)
ADD_SUBDIRECTORY(osgwidgetwindow) 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(osgscreencapture)
ADD_SUBDIRECTORY(osgmotionblur) ADD_SUBDIRECTORY(osgmotionblur)
ADD_SUBDIRECTORY(osgteapot) ADD_SUBDIRECTORY(osgteapot)

View File

@ -15,6 +15,7 @@
#define OSG_GL 1 #define OSG_GL 1
#include <osg/Config> #include <osg/Config>
#include <osg/Export>
#ifndef WIN32 #ifndef WIN32
@ -161,17 +162,4 @@
#define GL_LUMINANCE_ALPHA 0x190A #define GL_LUMINANCE_ALPHA 0x190A
#endif #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 #endif // __osgGL_h

View File

@ -17,9 +17,21 @@
#include <osg/Notify> #include <osg/Notify>
#include <osg/io_utils> #include <osg/io_utils>
namespace osg 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<typename T> template<typename T>
class TemplateAttributeDispatch : public AttributeDispatch class TemplateAttributeDispatch : public AttributeDispatch
{ {