1 #ifndef MSP_GLTK_GRAPHIC_H_
2 #define MSP_GLTK_GRAPHIC_H_
4 #include <msp/gl/primitivebuilder.h>
5 #include <msp/gl/texture2d.h>
6 #include <msp/datafile/loader.h>
15 Stores a single graphical element. Graphics are used as parts of widgets.
20 class Loader: public DataFile::Loader
27 typedef Resources Collection;
29 Loader(Graphic &, Resources &);
30 Graphic &get_object() const { return graph; }
32 void texture(const std::string &);
33 void slice(unsigned, unsigned, unsigned, unsigned);
41 const GL::Texture2D *texture;
47 const Sides &get_border() const { return border; }
48 const Sides &get_shadow() const { return shadow; }
49 const GL::Texture2D *get_texture() const { return texture; }
50 unsigned get_width() const { return slice.w; }
51 unsigned get_height() const { return slice.h; }
52 void build(unsigned, unsigned, GL::PrimitiveBuilder &) const;
54 void create_coords(float, float, float, float, float, std::vector<float> &) const;
55 void create_texcoords(float, float, float, float, float, std::vector<float> &) const;