X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ffont.cpp;fp=source%2Ffont.cpp;h=d03ce281aeae55e6c95daf327ad401e63059164b;hp=c96ec7507aeee520962acf37fcdb2c4a997f4a17;hb=a64e2e362cd7bce6f103f8878d69fcca4261bac9;hpb=6d0c86fc3211418ab4292d73f738e55043139b49 diff --git a/source/font.cpp b/source/font.cpp index c96ec750..d03ce281 100644 --- a/source/font.cpp +++ b/source/font.cpp @@ -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();)