Added support for texture object manager, which provides an automatic mechansim

for reusing deleted textures.
This commit is contained in:
Robert Osfield
2003-07-14 14:42:10 +00:00
parent 94d8e72ad3
commit 1b9d7d458a
18 changed files with 795 additions and 387 deletions

View File

@@ -207,20 +207,7 @@ void Text::setDrawMode(unsigned int mode)
{
if (_drawMode==mode) return;
if ((_drawMode&3) != (mode&3))
{
_drawMode=mode;
if (_drawMode&TEXT_PIXMAP)
{
setCharacterSizeMode(SCREEN_COORDS);
setAutoRotateToScreen(true);
}
computeGlyphRepresentation();
}
else
{
_drawMode=mode;
}
_drawMode=mode;
}
@@ -660,7 +647,7 @@ void Text::drawImplementation(osg::State& state) const
glNormal3fv(_normal.ptr());
glColor4fv(_color.ptr());
if (_drawMode & TEXT && !(_drawMode & TEXT_PIXMAP))
if (_drawMode & TEXT)
{
state.disableAllVertexArrays();
@@ -681,36 +668,6 @@ void Text::drawImplementation(osg::State& state) const
}
}
if (_drawMode & TEXT_PIXMAP)
{
state.applyTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::OFF);
for(TextureGlyphQuadMap::const_iterator titr=_textureGlyphQuadMap.begin();
titr!=_textureGlyphQuadMap.end();
++titr)
{
const GlyphQuads& glyphquad = titr->second;
int ci=1;
for(GlyphQuads::Glyphs::const_iterator gitr=glyphquad._glyphs.begin();
gitr!=glyphquad._glyphs.end();
++gitr, ci+=4)
{
Font::Glyph* glyph = *gitr;
glRasterPos3fv(glyphquad._transformedCoords[contextID][ci].ptr());
glyph->draw(state);
}
}
}
if (_drawMode & BOUNDINGBOX)
{