]> git.tdb.fi Git - libs/gltk.git/blob - source/partcache.h
86a3f364abe21260395493f40580d278f5b5775c
[libs/gltk.git] / source / partcache.h
1 #ifndef MSP_GLTK_PARTCACHE_H_
2 #define MSP_GLTK_PARTCACHE_H_
3
4 #include <msp/gl/mesh.h>
5 #include <msp/gl/texture2d.h>
6
7 namespace Msp {
8 namespace GLtk {
9
10 class Part;
11
12 struct CachedPart
13 {
14         const Part *part;
15         const GL::Texture2D *texture;
16         GL::Mesh *mesh;
17
18         CachedPart();
19         ~CachedPart();
20 };
21
22 class PartCache
23 {
24 public:
25         typedef std::list<CachedPart> PartList;
26
27 private:
28         PartList parts;
29
30 public:
31         void clear();
32         void insert_special(const Part &);
33         GL::Mesh &create_mesh(const Part &, const GL::Texture2D &);
34
35         const PartList &get_parts() const { return parts; }
36 };
37
38 } // namespace GLtk
39 } // namespace Msp
40
41 #endif