#include "mesh.h"
#include "snode.h"
#include "texture.h"
+#include "dataset.h"
enum {
SCNLOAD_FLIPYZ = 1,
- SCNLOAD_FLIPTEX = 2
+ SCNLOAD_FLIPTEX = 2,
+
+ SCNLOAD_STAGE_IO = 0x4000,
+ SCNLOAD_STAGE_GL = 0x8000
};
+class MetaScene;
+
class Scene {
private:
bool own_texset;
public:
+ MetaScene *metascn;
+
// meshes objects and nodes are owned by Scene
std::vector<Mesh*> meshes;
std::vector<Object*> objects;
Mesh *walk_mesh;
TextureSet *texset; // only owned by Scene if own_texset is true
+ void *loader_data;
explicit Scene(TextureSet *tset = 0);
~Scene();
bool load(const char *fname, unsigned int flags = 0);
+ // merge scn into this scene, leaving scn empty and safe to destroy
+ bool merge(Scene *scn);
+
void add_object(Object *obj);
bool remove_object(Object *obj);
bool have_object(Object *obj) const;
void draw() const;
};
+class SceneSet : public DataSet<Scene*> {
+private:
+ static Scene *create_scene();
+ static bool load_scene(Scene *scn, const char *fname);
+ static bool done_scene(Scene *scn);
+ static void free_scene(Scene *scn);
+
+public:
+ SceneSet();
+};
+
#endif // SCENE_H_