From 91564e36b09f797a381aa70c3bf3324a2b060323 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 9 Mar 2017 17:48:06 +0000 Subject: [PATCH] Cleaned up VertexArrayState handling --- src/osgText/Text.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index a8924c572..cbb41df74 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -1122,7 +1122,7 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie state.Normal(_normal.x(), _normal.y(), _normal.z()); - VertexArrayState* vas = state.getCurrentVertexArrayState(); + osg::VertexArrayState* vas = state.getCurrentVertexArrayState(); bool usingVertexArrayObjects = usingVertexBufferObjects && state.useVertexArrayObject(_useVertexArrayObject); bool requiresSetArrays = !usingVertexBufferObjects || !usingVertexArrayObjects || vas->getRequiresSetArrays(); @@ -1232,12 +1232,13 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie renderWithDelayedDepthWrites(state,colorMultiplier); } - if (!usingVertexArrayObjects) - { - // unbind the VBO's if any are used. - vas->unbindVertexBufferObject(); - vas->unbindElementBufferObject(); - } + } + + if (!usingVertexArrayObjects) + { + // unbind the VBO's if any are used. + vas->unbindVertexBufferObject(); + vas->unbindElementBufferObject(); } if (needToApplyMatrix)