]> git.tdb.fi Git - libs/demoscene.git/blob - source/stage.h
daf4f4b982c72ab52fa07008c79a10d2d2b1ba69
[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 struct Stage
9 {
10         class UseInView: public Action
11         {
12         public:
13                 class Loader: public Msp::DataFile::DerivedObjectLoader<UseInView, Action::Loader>
14                 {
15                 public:
16                         Loader(UseInView &, Demo &);
17
18                 private:
19                         void stage(const std::string &);
20                         void view(const std::string &);
21                 };
22
23         private:
24                 Msp::GL::View *view;
25                 Stage *stage;
26
27         public:
28                 UseInView();
29                 UseInView(Msp::GL::View &, Stage &);
30
31                 virtual void validate() const;
32
33                 virtual void start(float, float);
34         };
35
36         class SetCamera: public Action
37         {
38         public:
39                 class Loader: public Msp::DataFile::DerivedObjectLoader<SetCamera, Action::Loader>
40                 {
41                 public:
42                         Loader(SetCamera &, Demo &);
43
44                 private:
45                         void camera(const std::string &);
46                         void stage(const std::string &);
47                 };
48
49         private:
50                 Stage *stage;
51                 const Msp::GL::Camera *camera;
52
53         public:
54                 SetCamera();
55                 SetCamera(Stage &, const Msp::GL::Camera &);
56
57                 virtual void validate() const;
58
59                 virtual void start(float, float);
60         };
61
62         Msp::GL::Pipeline *pipeline;
63         Msp::GL::Camera camera;
64
65         Stage();
66         ~Stage();
67
68         void set_camera(const Msp::GL::Camera &);
69 };
70
71 #endif