diff --git a/include/osgText/Text b/include/osgText/Text index c5aea903e..70e257b4a 100644 --- a/include/osgText/Text +++ b/include/osgText/Text @@ -302,9 +302,6 @@ public: GlyphQuads(); GlyphQuads(const GlyphQuads& gq); - void initGlyphQuads(); - void initGPUBufferObjects(); - void setupPrimitives(Text::BackdropType backdropType); Glyphs& getGlyphs() { return _glyphs; } diff --git a/include/osgText/TextBase b/include/osgText/TextBase index a23807a1a..dae0da9c1 100644 --- a/include/osgText/TextBase +++ b/include/osgText/TextBase @@ -282,9 +282,7 @@ protected: void initArraysAndBuffers(); -#ifdef NEW_APPROACH osg::VertexArrayState* createVertexArrayState(osg::RenderInfo& renderInfo) const; -#endif bool computeMatrix(osg::Matrix& matrix, osg::State* state=0) const; diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index 8a180c6b4..a8924c572 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -573,16 +573,6 @@ void Text::computeGlyphRepresentation() } } - for(TextureGlyphQuadMap::iterator titr=_textureGlyphQuadMap.begin(); - titr!=_textureGlyphQuadMap.end(); - ++titr) - { - if (_useVertexBufferObjects) - { - titr->second.initGPUBufferObjects(); - } - } - computePositions(); computeColorGradients(); @@ -1132,8 +1122,6 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie state.Normal(_normal.x(), _normal.y(), _normal.z()); -#ifdef NEW_APPROACH - VertexArrayState* vas = state.getCurrentVertexArrayState(); bool usingVertexArrayObjects = usingVertexBufferObjects && state.useVertexArrayObject(_useVertexArrayObject); bool requiresSetArrays = !usingVertexBufferObjects || !usingVertexArrayObjects || vas->getRequiresSetArrays(); @@ -1145,14 +1133,6 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie vas->setTexCoordArray(state, 0, _texcoords.get()); vas->applyDisablingOfVertexAttributes(state); } -#else - state.lazyDisablingOfVertexAttributes(); - - state.setVertexPointer(_coords.get()); - state.setTexCoordPointer( 0, _texcoords.get()); - - state.applyDisablingOfVertexAttributes(); -#endif if ((_drawMode&(~TEXT))!=0) { @@ -1252,18 +1232,12 @@ void Text::drawImplementation(osg::State& state, const osg::Vec4& colorMultiplie renderWithDelayedDepthWrites(state,colorMultiplier); } -#ifdef NEW_APPROACH if (!usingVertexArrayObjects) { // unbind the VBO's if any are used. vas->unbindVertexBufferObject(); vas->unbindElementBufferObject(); } -#else - // unbind the VBO's if any are used. - state.unbindVertexBufferObject(); - state.unbindElementBufferObject(); -#endif } if (needToApplyMatrix) @@ -1397,7 +1371,6 @@ void Text::drawForegroundText(osg::State& state, const GlyphQuads& glyphquad, co if (coords.valid() && !coords->empty()) { -#ifdef NEW_APPROACH VertexArrayState* vas = state.getCurrentVertexArrayState(); bool usingVertexArrayObjects = usingVertexBufferObjects && state.useVertexArrayObject(_useVertexArrayObject); bool requiresSetArrays = !usingVertexBufferObjects || !usingVertexArrayObjects || vas->getRequiresSetArrays(); @@ -1414,19 +1387,6 @@ void Text::drawForegroundText(osg::State& state, const GlyphQuads& glyphquad, co vas->setColorArray(state, colors.get()); } } - -#else - if(_colorGradientMode == SOLID) - { - state.disableColorPointer(); - state.Color(colorMultiplier.r()*_color.r(),colorMultiplier.g()*_color.g(),colorMultiplier.b()*_color.b(),colorMultiplier.a()*_color.a()); - } - else - { - state.setColorPointer(colors.get()); - } -#endif - glyphquad._primitives[0]->draw(state, usingVertexBufferObjects); } } @@ -1836,36 +1796,12 @@ void Text::renderWithStencilBuffer(osg::State& state, const osg::Vec4& colorMult Text::GlyphQuads::GlyphQuads() { - initGlyphQuads(); } Text::GlyphQuads::GlyphQuads(const GlyphQuads&) { - initGlyphQuads(); } -void Text::GlyphQuads::initGlyphQuads() -{ -#ifndef NEW_APPROACH - _primitives.push_back(new DrawElementsUShort(PrimitiveSet::TRIANGLES)); -#endif -} - -void Text::GlyphQuads::initGPUBufferObjects() -{ -#ifndef NEW_APPROACH - // TODO... Need to set up to shade EBO's correctly. - osg::ref_ptr ebo = new osg::ElementBufferObject(); - for(Primitives::iterator itr = _primitives.begin(); - itr != _primitives.end(); - ++itr) - { - (*itr)->setElementBufferObject(ebo.get()); - } -#endif -} - - void Text::GlyphQuads::resizeGLObjectBuffers(unsigned int maxSize) { for(Primitives::iterator itr = _primitives.begin(); @@ -1874,8 +1810,6 @@ void Text::GlyphQuads::resizeGLObjectBuffers(unsigned int maxSize) { (*itr)->resizeGLObjectBuffers(maxSize); } - - // initGPUBufferObjects(); } void Text::GlyphQuads::releaseGLObjects(osg::State* state) const diff --git a/src/osgText/TextBase.cpp b/src/osgText/TextBase.cpp index 088ec9c3f..bfa8e3456 100644 --- a/src/osgText/TextBase.cpp +++ b/src/osgText/TextBase.cpp @@ -103,11 +103,8 @@ void TextBase::initArraysAndBuffers() _texcoords->setBufferObject(_vbo.get()); } -#ifdef NEW_APPROACH osg::VertexArrayState* TextBase::createVertexArrayState(osg::RenderInfo& renderInfo) const { - OSG_NOTICE<<"TextBase::createVertexArrayState()"<generateVertexArrayObject(); } else { - OSG_NOTICE<<" Setup VertexArrayState to without using VAO "<