]> git.tdb.fi Git - libs/gl.git/blobdiff - source/font.h
Add class MeshBuilder
[libs/gl.git] / source / font.h
index f647dbbdef1a07a92bcb75e8373822e028cf1316..b48c6445bb53a6d4136cd1d3c2b040edbf913c40 100644 (file)
@@ -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<class C>
        float get_string_width(const std::string &str) const
@@ -73,6 +75,16 @@ public:
        void draw_string(const std::string &str) const
        { draw_string<Codecs::Utf8>(str); }
 
+       template<class C>
+       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<Codecs::Utf8>(str, pb); }
+
 private:
        struct Glyph
        {