Name change and const change of Drawable::drawImmediateMode(State&) to

Drawable::drawImplementation(State&) const.   Various updates to the
rest of the OSG to accomodate this.
This commit is contained in:
Robert Osfield
2002-11-06 15:43:11 +00:00
parent e34ecafb1e
commit 3bd400130c
26 changed files with 112 additions and 74 deletions

View File

@@ -174,12 +174,17 @@ bool Font::create(osg::State& state)
return false;
}
void Font::output(osg::State& state,const char* text)
void Font::output(osg::State& state,const char* text) const
{
if(_created)
_font->render(text,state.getContextID());
else
create(state,_pointSize);
{
// ahhhh, this is bit doddy, the draw is potentially
// modifying the text object, this isn't thread safe.
Font* this_non_const = const_cast<Font*>(this);
this_non_const->create(state,_pointSize);
}
}
void Font::clear()

View File

@@ -168,19 +168,23 @@ bool Text::computeBound() const
return true;
}
void Text::drawImmediateMode(State& state)
void Text::drawImplementation(State& state) const
{
if(!_init)
return;
// ahhhh, this is bit doddy, the draw is potentially
// modifying the text object, this isn't thread safe.
Text* this_non_const = const_cast<Text*>(this);
if(!_font->isCreated())
{
_font->create(state);
dirtyBound();
this_non_const->_font->create(state);
this_non_const->dirtyBound();
}
if(!_initAlignment)
initAlignment();
this_non_const->initAlignment();
// we must disable all the vertex arrays to prevent any state
// propagating into text.
@@ -229,8 +233,7 @@ void Text::drawImmediateMode(State& state)
}
}
void Text::
drawBoundingBox(void)
void Text::drawBoundingBox(void) const
{
if(!_init)
return;
@@ -247,8 +250,7 @@ drawBoundingBox(void)
glPopAttrib();
}
void Text::
drawAlignment(void)
void Text::drawAlignment(void) const
{
if(!_init)
return;