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

@@ -36,16 +36,6 @@ public:
virtual const char* className() const { return "Text"; }
virtual const char* libraryName() const { return "osgText"; }
virtual void setFont(Font* font=0) { setFont(osg::ref_ptr<Font>(font)); };
/** Set the Font to use to render the text.*/
virtual void setFont(osg::ref_ptr<Font> font);
/** Set the font, loaded from the specified front file, to use to render the text,
* setFont("") sets the use of the default font.
* See the osgText::readFontFile function for how the font file will be located. */
virtual void setFont(const std::string& fontfile) { TextBase::setFont(fontfile); }
/**
* Turns off writing to the depth buffer when rendering text. This only affects text
* with no backdrop or text using the DELAYED_DEPTH_WRITES implementation, since
@@ -92,7 +82,9 @@ public:
* buffer. But if you don't need the depth buffer updated for
* your, this extra pass can be disabled by calling
* enableDepthWrites(false).*/
DELAYED_DEPTH_WRITES
DELAYED_DEPTH_WRITES,
USE_SHADERS
};
/**
@@ -284,6 +276,8 @@ protected:
virtual ~Text();
virtual osg::StateSet* createStateSet();
Font* getActiveFont();
const Font* getActiveFont() const;