]> git.tdb.fi Git - libs/gl.git/blobdiff - source/font.cpp
Change font methods to better differentiate between drawing and building
[libs/gl.git] / source / font.cpp
index c96ec7507aeee520962acf37fcdb2c4a997f4a17..d03ce281aeae55e6c95daf327ad401e63059164b 100644 (file)
@@ -56,16 +56,17 @@ float Font::get_string_width(const string &str, StringCodec::Decoder &dec) const
        return x;
 }
 
-void Font::draw_string(const string &str, StringCodec::Decoder &dec) const
+void Font::draw_string(const string &str, StringCodec::Decoder &dec, const Color &color) const
 {
+       Bind bind_tex(get_texture(), true);
        Immediate imm((TEXCOORD2, COLOR4_UBYTE, VERTEX2));
-       draw_string(str, dec, imm);
+       imm.color(color);
+       build_string(str, dec, imm);
 }
 
-void Font::draw_string(const string &str, StringCodec::Decoder &dec, PrimitiveBuilder &bld) const
+void Font::build_string(const string &str, StringCodec::Decoder &dec, PrimitiveBuilder &bld) const
 {
        MatrixStack::Push push_mtx(bld.matrix());
-       Bind bind_tex(get_texture(), true);
 
        bld.begin(QUADS);
        for(string::const_iterator i=str.begin(); i!=str.end();)