Change osgText so that the Text drawable now can have its own StateSet

that users can assign to it without it being overriden.  If none is
assigned externally it now uses a StateSet associated wit the Font assigned
to the Text.
This commit is contained in:
Robert Osfield
2006-07-04 13:56:29 +00:00
parent e8a3444b88
commit 3ad5140942
3 changed files with 33 additions and 4 deletions

View File

@@ -88,6 +88,11 @@ public:
virtual std::string getFileName() const;
void setStateSet(osg::StateSet* stateset) { _stateset = stateset; }
osg::StateSet* getStateSet() { return _stateset.get(); }
const osg::StateSet* getStateSet() const { return _stateset.get(); }
/** Set the pixel width and height hint.*/
virtual void setFontResolution(unsigned int width, unsigned int height);
@@ -152,6 +157,8 @@ protected:
typedef std::pair< unsigned int, unsigned int > SizePair;
typedef std::map< SizePair, GlyphMap > SizeGlyphMap;
osg::ref_ptr<osg::StateSet> _stateset;
SizeGlyphMap _sizeGlyphMap;
GlyphTextureList _glyphTextureList;
StateSetList _stateSetList;