]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/partcache.h
Make sure classes follow the rule of 0/3/5
[libs/gltk.git] / source / partcache.h
index 4eef1166d1d9e75f0bc39bd27b087350e8cbf3c1..8099676f95d177ecc3855bf00006db2a3aa11263 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <msp/gl/mesh.h>
 #include <msp/gl/texture2d.h>
+#include "mspgltk_api.h"
 
 namespace Msp {
 namespace GLtk {
@@ -11,15 +12,17 @@ class Part;
 
 struct CachedPart
 {
-       const Part *part;
-       const GL::Texture2D *texture;
-       GL::Mesh *mesh;
+       const Part *part = nullptr;
+       const GL::Texture2D *texture = nullptr;
+       GL::Mesh *mesh = nullptr;
 
-       CachedPart();
+       CachedPart() = default;
+       CachedPart(CachedPart &&);
+       CachedPart &operator=(CachedPart &&);
        ~CachedPart();
 };
 
-class PartCache
+class MSPGLTK_API PartCache
 {
 public:
        class Rebuild
@@ -35,14 +38,12 @@ public:
        typedef std::list<CachedPart> PartList;
 
 private:
-       bool rebuilding;
+       bool rebuilding = false;
        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 &);