Added TextSettings struct to manage values used to set up the text. with the addition of following command line parameters:

--outline // enable outlne
   --shadow // enable shadow
   --offset ratio // set the backdrop offset
   --text-color r g b a // set the text body color
   --bd-color r g b a // set the shadow/outline color
   --bg-color r g b a // window background color
   -o filename // write create subgraph to disk using specified filename
This commit is contained in:
Robert Osfield
2017-08-29 17:19:26 +01:00
parent 37487b0c0b
commit 5566a025b5
2 changed files with 75 additions and 8 deletions

View File

@@ -1131,6 +1131,8 @@ void Text::drawImplementationSinglePass(osg::State& state, const osg::Vec4& colo
#if 1
if(_backdropType != NONE)
{
OSG_NOTICE<<"Text::drawImplementationSinglePass() Drawing backdrop"<<std::endl;
unsigned int backdrop_index;
unsigned int max_backdrop_index;
if(_backdropType == OUTLINE)
@@ -1144,13 +1146,20 @@ void Text::drawImplementationSinglePass(osg::State& state, const osg::Vec4& colo
max_backdrop_index = backdrop_index+1;
}
OSG_NOTICE<<" 1 backdrop_index="<<backdrop_index<<", max_backdrop_index="<<max_backdrop_index<<std::endl;
if (max_backdrop_index>glyphquad._primitives.size()) max_backdrop_index=glyphquad._primitives.size();
OSG_NOTICE<<" 2 backdrop_index="<<backdrop_index<<", max_backdrop_index="<<max_backdrop_index<<std::endl;
state.disableColorPointer();
state.Color(_backdropColor.r(),_backdropColor.g(),_backdropColor.b(),_backdropColor.a());
OSG_NOTICE<<" _backdropColor("<<_backdropColor<<")"<<std::endl;
for( ; backdrop_index < max_backdrop_index; backdrop_index++)
{
OSG_NOTICE<<" draw backdrop "<<backdrop_index<<std::endl;
glyphquad._primitives[backdrop_index]->draw(state, usingVertexBufferObjects);
}
}