]> git.tdb.fi Git - libs/gl.git/blobdiff - source/font.cpp
Remove support for legacy OpenGL features
[libs/gl.git] / source / font.cpp
index 3fd24d8ea0ebde029e262d137dcfaf509b0db5ee..623f1ebebda04df2e97909b66c51416602e694a6 100644 (file)
@@ -74,7 +74,7 @@ void Font::draw_string(const string &str, StringCodec::Decoder &dec, const Color
 
 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 +94,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;
@@ -140,6 +140,20 @@ unsigned Font::get_ligature(unsigned code, unsigned next) const
 }
 
 
+Font::Glyph::Glyph():
+       code(0),
+       x1(0),
+       y1(0),
+       x2(1),
+       y2(1),
+       w(1),
+       h(1),
+       off_x(0),
+       off_y(0),
+       advance(1)
+{ }
+
+
 Font::Loader::Loader(Font &f):
        DataFile::CollectionObjectLoader<Font>(f, 0)
 {