]> git.tdb.fi Git - libs/gl.git/blobdiff - source/text.cpp
Share shader data between copied RenderPasses
[libs/gl.git] / source / text.cpp
index 03421f5457c5ed3385548034115a6e18e1933269..f791c3b269632e1ed2113554d8095f55182102c2 100644 (file)
@@ -23,7 +23,7 @@ void Text::set_technique(const Technique *tech)
        if(tech)
        {
                technique = *tech;
-               technique.replace_texture("diffusemap", font.get_texture());
+               technique.replace_texture("diffuse_map", font.get_texture());
                object.set_technique(&technique);
        }
        else
@@ -34,7 +34,7 @@ void Text::set_text(const string &text, StringCodec::Decoder &dec)
 {
        clear();
        width = font.get_string_width(text, dec);
-       GL::MeshBuilder bld(mesh);
+       MeshBuilder bld(mesh);
        bld.matrix() *= Matrix::translation(Vector3(-horz_align*width, vert_offset, 0.0f));
        font.build_string(text, dec, bld);
 }
@@ -71,6 +71,9 @@ void Text::set_alignment(HorizontalAlign ha, VerticalAlign va)
 
 void Text::set_alignment(float h, float v)
 {
+       if(h==horz_align && -v==vert_offset)
+               return;
+
        float horz_adjust = (horz_align-h)*width;
        float vert_adjust = -v-vert_offset;
        horz_align = h;