From: Thomas Geymayer Date: Sun, 30 Jun 2013 19:25:21 +0000 (+0200) Subject: Restore compatibility with stable OSG (3.0.1) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=14eccc70da6d3208da214f74fc1d0ac5629d8fc0;p=simgear.git Restore compatibility with stable OSG (3.0.1) --- diff --git a/simgear/canvas/elements/CanvasText.cxx b/simgear/canvas/elements/CanvasText.cxx index 031adba7..1ed7be49 100644 --- a/simgear/canvas/elements/CanvasText.cxx +++ b/simgear/canvas/elements/CanvasText.cxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include namespace simgear @@ -175,7 +175,7 @@ namespace canvas if( !bb.valid() ) return bb; -#if SG_OSG_VERSION_LESS_THAN(3,1,0) +#if OSG_VERSION_LESS_THAN(3,1,0) // TODO bounding box still doesn't seem always right (eg. with center // horizontal alignment not completely accurate) bb._min.y() += _offset.y(); diff --git a/simgear/scene/material/EffectGeode.cxx b/simgear/scene/material/EffectGeode.cxx index 6119f107..c2967639 100644 --- a/simgear/scene/material/EffectGeode.cxx +++ b/simgear/scene/material/EffectGeode.cxx @@ -22,6 +22,8 @@ #include "Effect.hxx" #include "Technique.hxx" +#include + #include #include @@ -80,15 +82,27 @@ void EffectGeode::runGenerators(osg::Geometry *geometry) int n = _effect->getGenerator(Effect::TANGENT); tsg->generate(geometry, 0); // 0 is normal_unit, but I have no idea what that is! if (n != -1 && !geometry->getVertexAttribArray(n)) - geometry->setVertexAttribArray(n, tsg->getTangentArray()); +#if OSG_MIN_VERSION_REQUIRED(3,1,8) + geometry->setVertexAttribArray(n, tsg->getTangentArray(), osg::Array::BIND_PER_VERTEX); +#else + geometry->setVertexAttribData(n, osg::Geometry::ArrayData(tsg->getTangentArray(), osg::Geometry::BIND_PER_VERTEX,GL_FALSE)); +#endif n = _effect->getGenerator(Effect::BINORMAL); if (n != -1 && !geometry->getVertexAttribArray(n)) - geometry->setVertexAttribArray(n, tsg->getBinormalArray()); +#if OSG_MIN_VERSION_REQUIRED(3,1,8) + geometry->setVertexAttribArray(n, tsg->getBinormalArray(), osg::Array::BIND_PER_VERTEX); +#else + geometry->setVertexAttribData(n, osg::Geometry::ArrayData(tsg->getBinormalArray(), osg::Geometry::BIND_PER_VERTEX,GL_FALSE)); +#endif n = _effect->getGenerator(Effect::NORMAL); if (n != -1 && !geometry->getVertexAttribArray(n)) - geometry->setVertexAttribArray(n, tsg->getNormalArray()); +#if OSG_MIN_VERSION_REQUIRED(3,1,8) + geometry->setVertexAttribArray(n, tsg->getNormalArray(), osg::Array::BIND_PER_VERTEX); +#else + geometry->setVertexAttribData(n, osg::Geometry::ArrayData(tsg->getNormalArray(), osg::Geometry::BIND_PER_VERTEX,GL_FALSE)); +#endif } }