Added support for multiple graphics contexts, submission from Max Rhiener.
Alas changed the indenting to use 4 spaces instead of tabs, this irons out differences when working under Windows and Unix, keeping the identing consistent.
This commit is contained in:
@@ -110,21 +110,28 @@ open(const std::string& font)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Font::
|
||||
open(const char* font)
|
||||
{ return open(std::string(font)); }
|
||||
|
||||
bool Font::
|
||||
create(int pointSize,const unsigned int res)
|
||||
create(osg::State& state,int pointSize,const unsigned int res)
|
||||
{
|
||||
_pointSize=pointSize;
|
||||
_res=res;
|
||||
|
||||
return create();
|
||||
return create(state);
|
||||
}
|
||||
|
||||
bool Font::
|
||||
create()
|
||||
create(osg::State& state)
|
||||
{
|
||||
if(_init)
|
||||
{
|
||||
if(_font->FaceSize(_pointSize,_res))
|
||||
if(_font->Created(state.getContextID()))
|
||||
return true;
|
||||
|
||||
if(_font->FaceSize(_pointSize,_res,state.getContextID()))
|
||||
{
|
||||
_created=true;
|
||||
return true;
|
||||
@@ -137,12 +144,12 @@ create()
|
||||
}
|
||||
|
||||
void Font::
|
||||
output(const char* text)
|
||||
output(osg::State& state,const char* text)
|
||||
{
|
||||
if(_created)
|
||||
_font->render(text);
|
||||
_font->render(text,state.getContextID());
|
||||
else
|
||||
create(_pointSize);
|
||||
create(state,_pointSize);
|
||||
}
|
||||
|
||||
void Font::
|
||||
@@ -328,6 +335,19 @@ VectorFont(font)
|
||||
_precision=precision;
|
||||
}
|
||||
|
||||
PolygonFont::
|
||||
PolygonFont(const char* font,
|
||||
int point_size,
|
||||
double precision):
|
||||
VectorFont(std::string(font))
|
||||
{
|
||||
if(init(font))
|
||||
{
|
||||
}
|
||||
_pointSize=point_size;
|
||||
_precision=precision;
|
||||
}
|
||||
|
||||
FTFont* PolygonFont::
|
||||
createFontObj(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user