- made some small performance updates for rendering and updated beta version number

This commit is contained in:
Mark Vejvoda
2010-06-25 05:41:50 +00:00
parent 848d953bd7
commit 646e8593f4
7 changed files with 13 additions and 11 deletions

View File

@@ -32,7 +32,7 @@ public:
TextRenderer2DGl();
virtual void begin(const Font2D *font);
virtual void render(const string &text, int x, int y, bool centered, Vec3f color);
virtual void render(const string &text, int x, int y, bool centered, Vec3f *color=NULL);
virtual void end();
};

View File

@@ -30,7 +30,7 @@ public:
virtual ~TextRenderer2D(){};
virtual void begin(const Font2D *font)= 0;
virtual void render(const string &text, int x, int y, bool centered= false,Vec3f color=Vec3f(-1.0))= 0;
virtual void render(const string &text, int x, int y, bool centered= false,Vec3f *color=NULL)= 0;
virtual void end()= 0;
};

View File

@@ -32,14 +32,14 @@ void TextRenderer2DGl::begin(const Font2D *font){
this->font= static_cast<const Font2DGl*>(font);
}
void TextRenderer2DGl::render(const string &text, int x, int y, bool centered, Vec3f color) {
void TextRenderer2DGl::render(const string &text, int x, int y, bool centered, Vec3f *color) {
assert(rendering);
assertGl();
if(color.x >= 0) {
if(color != NULL) {
glPushAttrib(GL_CURRENT_BIT);
glColor3fv(color.ptr());
glColor3fv(color->ptr());
}
int line=0;
@@ -73,7 +73,7 @@ void TextRenderer2DGl::render(const string &text, int x, int y, bool centered, V
}
}
if(color.x >= 0) {
if(color != NULL) {
glPopAttrib();
}
assertGl();