]> git.tdb.fi Git - libs/gl.git/blobdiff - source/font.cpp
Remove the deprecated ProgramBuilder class
[libs/gl.git] / source / font.cpp
index fba9f331fb7e7cbcceaaf04e21eca8215f89aa46..5990c57d7223771410edadcfb69a9df13ea39fe0 100644 (file)
@@ -3,8 +3,7 @@
 #include "bindable.h"
 #include "gl.h"
 #include "font.h"
-#include "immediate.h"
-#include "primitivetype.h"
+#include "primitivebuilder.h"
 #include "texture2d.h"
 
 using namespace std;
@@ -64,17 +63,9 @@ 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 Color &color) const
-{
-       BindRestore bind_tex(get_texture());
-       Immediate imm((TEXCOORD2, COLOR4_UBYTE, VERTEX2));
-       imm.color(color);
-       build_string(str, dec, imm);
-}
-
 void Font::build_string(const string &str, StringCodec::Decoder &dec, PrimitiveBuilder &bld) const
 {
-       MatrixStack::Push push_mtx(bld.matrix());
+       VertexBuilder::PushMatrix push_mtx(bld);
 
        unsigned prev = 0;
        unsigned next = 0;
@@ -94,7 +85,7 @@ void Font::build_string(const string &str, StringCodec::Decoder &dec, PrimitiveB
                        continue;
 
                if(prev)
-                       bld.matrix() *= Matrix::translation(get_glyph_advance(prev, c), 0, 0);
+                       bld.transform(Matrix::translation(get_glyph_advance(prev, c), 0, 0));
 
                create_glyph_quad(j->second, bld);
                prev = c;