#include <msp/gl/matrix.h>
-#include <msp/gl/transform.h>
+#include <msp/gl/meshbuilder.h>
#include "graphic.h"
#include "part.h"
#include "style.h"
}
}
-void VSlider::render_special(const Part &part) const
+void VSlider::rebuild_special(const Part &part, CachedPart &cache)
{
if(part.get_name()=="slider")
{
Geometry pgeom = part.get_geometry();
align.apply(pgeom, geom, part.get_margin());
- GL::push_matrix();
- GL::translate(pgeom.x, pgeom.y, 0);
- part.get_graphic(state)->render(pgeom.w, pgeom.h);
- GL::pop_matrix();
+ cache.texture = part.get_graphic(state)->get_texture();
+ cache.clear_mesh();
+
+ GL::MeshBuilder bld(*cache.mesh);
+ bld.matrix() *= GL::Matrix::translation(pgeom.x, pgeom.y, 0);
+ part.get_graphic(state)->build(pgeom.w, pgeom.h, bld);
}
}