diff options
Diffstat (limited to 'src/render/text.h')
-rw-r--r-- | src/render/text.h | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/render/text.h b/src/render/text.h index ac7d104..47d88fd 100644 --- a/src/render/text.h +++ b/src/render/text.h @@ -10,22 +10,39 @@ #include <string> #include <sstream> -#define CHARWIDTH 16 -#define CHARHEIGHT 24 - namespace render { - /// draw a character - void draw_text(float x, float y, const char ascii); +class Text { +public: /// draw a text string - void draw_text(float x, float y, const std::string & text); + static void draw(float x, float y, const std::string & text); + /// draw a text string - void draw_text(float x, float y, const char *text); + + static void draw(float x, float y, const char *text); /// draw a text stream /** If the stream contains multiple lines, each new line will be * drawn at the same x value. The stream is cleared after reading */ - void draw_text(float x, float y, std::stringstream & textstream); + static void draw(float x, float y, std::stringstream & textstream); + + /// draw a character + static void draw(float x, float y, const char ascii); + + /// set the font + static void setfont(const char *texture, float width, float height); + + /// current font width + static inline float fontwidth() { return text_fontwidth; } + + /// current font height + static inline float fontheight() { return text_fontheight; } + +private: + static float text_fontwidth; + static float text_fontheight; +}; + } #endif //__INCLUDED_RENDER_TEXT_H__ |