+ const Part *part = nullptr;
+ const GL::Texture2D *texture = nullptr;
+ std::unique_ptr<GL::Mesh> mesh;
+};
+
+class MSPGLTK_API PartCache
+{
+public:
+ class Rebuild
+ {
+ private:
+ PartCache &cache;
+
+ public:
+ Rebuild(PartCache &c): cache(c) { cache.begin_rebuild(); }
+ ~Rebuild() { cache.end_rebuild(); }
+ };
+
+private:
+ bool rebuilding = false;
+ std::vector<CachedPart> parts;
+ std::vector<CachedPart>::iterator next;
+ std::vector<CachedPart>::iterator current;