diff --git a/src/osgText/Text3D.cpp b/src/osgText/Text3D.cpp index 719f91f6a..b21927a8d 100644 --- a/src/osgText/Text3D.cpp +++ b/src/osgText/Text3D.cpp @@ -499,13 +499,17 @@ void Text3D::drawImplementation(osg::RenderInfo& renderInfo) const // OSG_NOTICE<<"No need to apply matrix "<getRequiresSetArrays(); - state.lazyDisablingOfVertexAttributes(); - - state.setVertexPointer(_coords.get()); - state.setNormalPointer(_normals.get()); - - state.applyDisablingOfVertexAttributes(); + if (requiresSetArrays) + { + vas->lazyDisablingOfVertexAttributes(); + vas->setVertexArray(state, _coords.get()); + vas->setNormalArray(state, _normals.get()); + vas->applyDisablingOfVertexAttributes(state); + } if ((_drawMode&(~TEXT))!=0) { @@ -559,6 +563,13 @@ void Text3D::drawImplementation(osg::RenderInfo& renderInfo) const } } + if (!usingVertexArrayObjects) + { + // unbind the VBO's if any are used. + vas->unbindVertexBufferObject(); + vas->unbindElementBufferObject(); + } + if (needToApplyMatrix) { // restore the previous modelview matrix