mirror of
https://github.com/glest/glest-source.git
synced 2025-08-13 11:54:00 +02:00
- reworked fonts to now use 3d matrix positioning and render performance is much better.
*NOTE: Still need to deal with some letters getting partially chopped off in some cases.
This commit is contained in:
@@ -38,7 +38,7 @@ public:
|
||||
virtual ~TextRenderer2DGl();
|
||||
|
||||
virtual void begin(Font2D *font);
|
||||
virtual void render(const string &text, int x, int y, bool centered, Vec3f *color=NULL);
|
||||
virtual void render(const string &text, float x, float y, bool centered=false, Vec3f *color=NULL);
|
||||
virtual void end();
|
||||
};
|
||||
|
||||
@@ -51,12 +51,14 @@ private:
|
||||
Font3DGl *font;
|
||||
bool rendering;
|
||||
|
||||
void internalRender(const string &text, float x, float y, bool centered, Vec3f *color);
|
||||
|
||||
public:
|
||||
TextRenderer3DGl();
|
||||
virtual ~TextRenderer3DGl();
|
||||
|
||||
virtual void begin(Font3D *font);
|
||||
virtual void render(const string &text, float x, float y, bool centered);
|
||||
virtual void render(const string &text, float x, float y, bool centered=false, Vec3f *color=NULL);
|
||||
virtual void end();
|
||||
};
|
||||
|
||||
|
@@ -25,26 +25,32 @@ namespace Shared { namespace Graphics {
|
||||
// class TextRenderer2D
|
||||
// =====================================================
|
||||
|
||||
class TextRenderer2D {
|
||||
class TextRenderer {
|
||||
public:
|
||||
virtual void render(const string &text, float x, float y, bool centered=false, Vec3f *color=NULL) = 0;
|
||||
virtual void end()= 0;
|
||||
};
|
||||
|
||||
class TextRenderer2D : public TextRenderer {
|
||||
public:
|
||||
virtual ~TextRenderer2D(){};
|
||||
|
||||
virtual void begin(Font2D *font)= 0;
|
||||
virtual void render(const string &text, int x, int y, bool centered= false,Vec3f *color=NULL)= 0;
|
||||
virtual void end()= 0;
|
||||
//virtual void render(const string &text, int x, int y, bool centered= false,Vec3f *color=NULL)= 0;
|
||||
//virtual void end()= 0;
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
// class TextRenderer3D
|
||||
// =====================================================
|
||||
|
||||
class TextRenderer3D {
|
||||
class TextRenderer3D : public TextRenderer {
|
||||
public:
|
||||
virtual ~TextRenderer3D(){};
|
||||
|
||||
virtual void begin(Font3D *font)= 0;
|
||||
virtual void render(const string &text, float x, float y, bool centered= false)= 0;
|
||||
virtual void end()= 0;
|
||||
//virtual void render(const string &text, float x, float y, bool centered= false,Vec3f *color=NULL)= 0;
|
||||
//virtual void end()= 0;
|
||||
};
|
||||
|
||||
}}//end namespace
|
||||
|
Reference in New Issue
Block a user