Shifted set up of osgText related StateSet from osgText::Font into into osg::TextBase/Text to enable grater control over state required for specific Text implementations

This commit is contained in:
Robert Osfield
2017-09-12 11:50:47 +01:00
parent f98c23d460
commit 722ed6fc5e
6 changed files with 193 additions and 171 deletions

View File

@@ -50,7 +50,6 @@ TextBase::TextBase():
_lineCount(0),
_glyphNormalized(false)
{
setStateSet(Font::getDefaultFont()->getStateSet());
setUseDisplayList(false);
setSupportsDisplayList(false);
@@ -89,6 +88,11 @@ TextBase::~TextBase()
{
}
osg::StateSet* TextBase::createStateSet()
{
return 0;
}
void TextBase::initArraysAndBuffers()
{
_vbo = new osg::VertexBufferObject;
@@ -182,6 +186,10 @@ void TextBase::setColor(const osg::Vec4& color)
_color = color;
}
void TextBase::assignStateSet()
{
setStateSet(createStateSet());
}
void TextBase::setFont(osg::ref_ptr<Font> font)
{
@@ -189,6 +197,8 @@ void TextBase::setFont(osg::ref_ptr<Font> font)
_font = font;
assignStateSet();
computeGlyphRepresentation();
}