diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-11 15:16:25 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-11 15:16:25 +0000 |
commit | d2e93235b9ccd37bf8c8fb7c4376ab1911c83639 (patch) | |
tree | 61bfbf023228ba10abe488d8c8bd27359171c9f7 /src/render/text.h | |
parent | d82c8f449c604d0f957e3dd190f7beae3596e6f9 (diff) |
console font
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__ |