]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/button.cpp
Reuse meshes in PartCache to avoid buffer create/delete spam
[libs/gltk.git] / source / button.cpp
index 58fc134cde2a9d551c80ad9b303bcd7773423304..57e5fa42f57981cfb3398576b5a6563b3d5b4843 100644 (file)
@@ -16,7 +16,7 @@ Button::Button(const std::string &t):
        set_text(t);
 }
 
-void Button::autosize_special(const Part &part, Geometry &ageom)
+void Button::autosize_special(const Part &part, Geometry &ageom) const
 {
        if(part.get_name()=="text")
                text.autosize(part, ageom);
@@ -44,7 +44,7 @@ void Button::set_icon(const GL::Texture2D *i)
 void Button::rebuild_special(const Part &part)
 {
        if(part.get_name()=="text")
-               text.build(part, geom, part_cache);
+               text.build(part, state, geom, part_cache);
        if(part.get_name()=="icon")
        {
                if(icon)