X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffont.h;h=b48c6445bb53a6d4136cd1d3c2b040edbf913c40;hb=6a135773515b020ea3f163a11d06150ae5c0e69f;hp=f647dbbdef1a07a92bcb75e8373822e028cf1316;hpb=d1800d7ea80290f4913d0203241cef1409656522;p=libs%2Fgl.git diff --git a/source/font.h b/source/font.h index f647dbbd..b48c6445 100644 --- a/source/font.h +++ b/source/font.h @@ -17,6 +17,7 @@ Distributed under the LGPL namespace Msp { namespace GL { +class PrimitiveBuilder; class Texture2D; class Font @@ -44,6 +45,7 @@ public: Font(); void set_texture(const Texture2D &); + const Texture2D &get_texture() const; void add_glyph(unsigned, float, float, float, float, float, float, float, float, float); float get_default_size() const { return default_size; } float get_ascent() const { return ascent; } @@ -51,7 +53,7 @@ public: float get_string_width(const std::string &, Codecs::Decoder &) const; void draw_glyph(unsigned); void draw_string(const std::string &, Codecs::Decoder &) const; - void draw_multiline(const std::string &) const; + void draw_string(const std::string &, Codecs::Decoder &, PrimitiveBuilder &) const; template float get_string_width(const std::string &str) const @@ -73,6 +75,16 @@ public: void draw_string(const std::string &str) const { draw_string(str); } + template + void draw_string(const std::string &str, PrimitiveBuilder &pb) const + { + typename C::Decoder dec; + draw_string(str, dec, pb); + } + + void draw_string(const std::string &str, PrimitiveBuilder &pb) const + { return draw_string(str, pb); } + private: struct Glyph {