]> git.tdb.fi Git - libs/demoscene.git/blobdiff - source/stage.h
Make it possible for Stages to add things to the Demo
[libs/demoscene.git] / source / stage.h
index c43cccb31601e2d86637706c69224973f7489979..c108f6fcd66ddda1f9c5b9ca0cb2324d23227db9 100644 (file)
@@ -1,12 +1,14 @@
 #ifndef MSP_DEMOSCENE_STAGE_H_
 #define MSP_DEMOSCENE_STAGE_H_
 
+#include <msp/gl/camera.h>
 #include <msp/gl/pipeline.h>
-#include "cameracontrol.h"
 #include "action.h"
+#include "demo.h"
 
-struct Stage
+class Stage
 {
+public:
        class UseInView: public Action
        {
        public:
@@ -16,8 +18,8 @@ struct Stage
                        Loader(UseInView &, Demo &);
 
                private:
-                       void view(const std::string &);
                        void stage(const std::string &);
+                       void view(const std::string &);
                };
 
        private:
@@ -33,11 +35,44 @@ struct Stage
                virtual void start(float, float);
        };
 
+       class SetCamera: public Action
+       {
+       public:
+               class Loader: public Msp::DataFile::DerivedObjectLoader<SetCamera, Action::Loader>
+               {
+               public:
+                       Loader(SetCamera &, Demo &);
+
+               private:
+                       void camera(const std::string &);
+                       void stage(const std::string &);
+               };
+
+       private:
+               Stage *stage;
+               const Msp::GL::Camera *camera;
+
+       public:
+               SetCamera();
+               SetCamera(Stage &, const Msp::GL::Camera &);
+
+               virtual void validate() const;
+
+               virtual void start(float, float);
+       };
+
+protected:
        Msp::GL::Pipeline *pipeline;
-       CameraControl camera_control;
+       Msp::GL::Camera camera;
 
+public:
        Stage();
        ~Stage();
+
+       virtual void add_things(Demo::ThingMap &, const std::string &);
+       void add_postprocessor(Msp::GL::PostProcessor &);
+       void set_camera(const Msp::GL::Camera &);
+       Msp::GL::Camera &get_camera() { return camera; }
 };
 
 #endif