]> git.tdb.fi Git - libs/demoscene.git/blobdiff - source/stage.h
Create Stage pipeline when added to a view
[libs/demoscene.git] / source / stage.h
index 1ab32d83d27d07fa50be5510c5b7bf8216ab43db..7d4664fb2b4a2a70122abb04a5ba5e4092378c42 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:
@@ -33,11 +35,48 @@ 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;
+       Msp::GL::View *last_view;
 
+public:
        Stage();
        ~Stage();
+
+       virtual void add_things(Demo::ThingMap &, const std::string &);
+
+       void set_camera(const Msp::GL::Camera &);
+       Msp::GL::Camera &get_camera() { return camera; }
+
+protected:
+       virtual void create_pipeline(Msp::GL::View &) = 0;
 };
 
 #endif