diff --git a/src/osg/PointSprite.cpp b/src/osg/PointSprite.cpp index 2d53f61e9..0bf9330bf 100644 --- a/src/osg/PointSprite.cpp +++ b/src/osg/PointSprite.cpp @@ -44,17 +44,31 @@ bool PointSprite::checkValidityOfAssociatedModes(osg::State& state) const { bool modeValid = isPointSpriteSupported(state.getContextID()); - state.setModeValidity(GL_POINT_SPRITE_ARB, modeValid); +#if defined( OSG_GLES1_AVAILABLE ) || defined( OSG_GLES2_AVAILABLE ) + state.setModeValidity(GL_POINT_SPRITE_OES, modeValid); +#else + state.setModeValidity(GL_POINT_SPRITE_ARB, modeValid); +#endif + return modeValid; } void PointSprite::apply(osg::State& state) const { #if defined( OSG_GL3_AVAILABLE ) + const Point::Extensions* extensions = Point::getExtensions(state.getContextID(),true); extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode); + +#elif defined( OSG_GLES1_AVAILABLE ) || defined( OSG_GLES2_AVAILABLE ) + + if(!isPointSpriteSupported(state.getContextID())) return; + + glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, 1); + #elif defined( OSG_GL_FIXED_FUNCTION_AVAILABLE ) + if(!isPointSpriteSupported(state.getContextID())) return; glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, 1); @@ -63,8 +77,10 @@ void PointSprite::apply(osg::State& state) const if (extensions->isPointSpriteCoordOriginSupported()) extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode); + #else OSG_NOTICE<<"Warning: PointSprite::apply(State&) - not supported."<