]> git.tdb.fi Git - libs/demoscene.git/blob - source/stage.h
Turn Stage into a class
[libs/demoscene.git] / source / stage.h
1 #ifndef MSP_DEMOSCENE_STAGE_H_
2 #define MSP_DEMOSCENE_STAGE_H_
3
4 #include <msp/gl/camera.h>
5 #include <msp/gl/pipeline.h>
6 #include "action.h"
7
8 class Stage
9 {
10 public:
11         class UseInView: public Action
12         {
13         public:
14                 class Loader: public Msp::DataFile::DerivedObjectLoader<UseInView, Action::Loader>
15                 {
16                 public:
17                         Loader(UseInView &, Demo &);
18
19                 private:
20                         void stage(const std::string &);
21                         void view(const std::string &);
22                 };
23
24         private:
25                 Msp::GL::View *view;
26                 Stage *stage;
27
28         public:
29                 UseInView();
30                 UseInView(Msp::GL::View &, Stage &);
31
32                 virtual void validate() const;
33
34                 virtual void start(float, float);
35         };
36
37         class SetCamera: public Action
38         {
39         public:
40                 class Loader: public Msp::DataFile::DerivedObjectLoader<SetCamera, Action::Loader>
41                 {
42                 public:
43                         Loader(SetCamera &, Demo &);
44
45                 private:
46                         void camera(const std::string &);
47                         void stage(const std::string &);
48                 };
49
50         private:
51                 Stage *stage;
52                 const Msp::GL::Camera *camera;
53
54         public:
55                 SetCamera();
56                 SetCamera(Stage &, const Msp::GL::Camera &);
57
58                 virtual void validate() const;
59
60                 virtual void start(float, float);
61         };
62
63 protected:
64         Msp::GL::Pipeline *pipeline;
65         Msp::GL::Camera camera;
66
67 public:
68         Stage();
69         ~Stage();
70
71         void add_postprocessor(Msp::GL::PostProcessor &);
72         void set_camera(const Msp::GL::Camera &);
73         Msp::GL::Camera &get_camera() { return camera; }
74 };
75
76 #endif