X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphic.h;h=32a06864f9dcebf260c9f52e154b141e95660ba1;hb=81c4024fb6acf37df702a803dc4efdf82a81525a;hp=f457d3690b297a91d989dc92ed9ce5fa634268d4;hpb=1aa6cd9b865e366737dcc9d2d36c4f8faed5bc4f;p=libs%2Fgltk.git diff --git a/source/graphic.h b/source/graphic.h index f457d36..32a0686 100644 --- a/source/graphic.h +++ b/source/graphic.h @@ -3,8 +3,9 @@ #include #include -#include +#include #include "geometry.h" +#include "mspgltk_api.h" namespace Msp { namespace GLtk { @@ -14,20 +15,14 @@ class Resources; /** Stores a single graphical element. Graphics are used as parts of widgets. */ -class Graphic +class MSPGLTK_API Graphic { public: - class Loader: public DataFile::Loader + class Loader: public DataFile::CollectionObjectLoader { - private: - Graphic &graph; - Resources &res; - public: - typedef Resources Collection; - Loader(Graphic &, Resources &); - Graphic &get_object() const { return graph; } + private: void texture(const std::string &); void slice(unsigned, unsigned, unsigned, unsigned); @@ -38,12 +33,11 @@ public: private: Sides border; Sides shadow; - const GL::Texture2D *texture; + const GL::Texture2D *texture = nullptr; Geometry slice; - bool repeat; + bool repeat = false; public: - Graphic(); const Sides &get_border() const { return border; } const Sides &get_shadow() const { return shadow; } const GL::Texture2D *get_texture() const { return texture; }