summaryrefslogtreecommitdiff
path: root/model.h
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-07-03 15:33:54 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-07-03 15:33:54 +0200
commit5205d99629a9b15865e7a1950b49d8da40a91309 (patch)
tree91b3deb782dac4432d48935b0566805123951d92 /model.h
parent75a90df8bf7f38e746e021c23248e1607931132c (diff)
Load and save terrain objects, added ModelManager for object models.HEADmaster
Diffstat (limited to 'model.h')
-rw-r--r--model.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/model.h b/model.h
index 7659d9c..dda3228 100644
--- a/model.h
+++ b/model.h
@@ -5,6 +5,7 @@
#include <assimp/assimp.hpp>
#include <assimp/aiScene.h>
+#include <boost/shared_ptr.hpp>
#include <map>
#include <string>
@@ -28,6 +29,8 @@ class Mesh {
class Model {
public:
+ typedef boost::shared_ptr<Model> p;
+
virtual ~Model() {};
virtual void render() = 0;
@@ -45,6 +48,18 @@ class Tree : public Model {
virtual void render();
};
+class ModelManager {
+ private:
+ static ModelManager *model_mgr;
+ std::map<const std::string, Model::p> models;
+
+ public:
+ void add_model(const std::string name, Model::p model);
+ Model::p get_model(const std::string name);
+
+ static ModelManager& get_instance();
+};
+
}
#endif