1 #ifndef MSP_GLTK_PARTCACHE_H_
2 #define MSP_GLTK_PARTCACHE_H_
4 #include <msp/gl/mesh.h>
5 #include <msp/gl/texture2d.h>
6 #include "mspgltk_api.h"
15 const Part *part = nullptr;
16 const GL::Texture2D *texture = nullptr;
17 GL::Mesh *mesh = nullptr;
19 CachedPart() = default;
20 CachedPart(CachedPart &&);
21 CachedPart &operator=(CachedPart &&);
25 class MSPGLTK_API PartCache
34 Rebuild(PartCache &c): cache(c) { cache.begin_rebuild(); }
35 ~Rebuild() { cache.end_rebuild(); }
38 typedef std::list<CachedPart> PartList;
41 bool rebuilding = false;
43 PartList::iterator next;
44 PartList::iterator current;
48 void insert_special(const Part &);
49 GL::Mesh &create_mesh(const Part &, const GL::Texture2D &);
52 const PartList &get_parts() const { return parts; }