X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpartcache.h;h=9dc71bf184c8652de6b5e4939a8bab9224a2f512;hb=56c41b294aa47a38ac3e1be70d4868f260cb4274;hp=90d1c94f5e36e90a19614cc39a9e8a56033d7945;hpb=2a665655a15f73d59083fd5cc7e5a58ae5f4d377;p=libs%2Fgltk.git diff --git a/source/partcache.h b/source/partcache.h index 90d1c94..9dc71bf 100644 --- a/source/partcache.h +++ b/source/partcache.h @@ -3,6 +3,7 @@ #include #include +#include "mspgltk_api.h" namespace Msp { namespace GLtk { @@ -19,17 +20,30 @@ struct CachedPart ~CachedPart(); }; -class PartCache +class MSPGLTK_API PartCache { public: + class Rebuild + { + private: + PartCache &cache; + + public: + Rebuild(PartCache &c): cache(c) { cache.begin_rebuild(); } + ~Rebuild() { cache.end_rebuild(); } + }; + typedef std::list PartList; private: + bool rebuilding; PartList parts; PartList::iterator next; PartList::iterator current; public: + PartCache(); + void begin_rebuild(); void insert_special(const Part &); GL::Mesh &create_mesh(const Part &, const GL::Texture2D &);