]> git.localhorst.tv Git - blobs.git/blob - src/app/MasterState.hpp
simple planet render
[blobs.git] / src / app / MasterState.hpp
1 #ifndef BLOBS_APP_MASTERSTATE_HPP_
2 #define BLOBS_APP_MASTERSTATE_HPP_
3
4 #include "State.hpp"
5
6 #include "Assets.hpp"
7 #include "../graphics/Camera.hpp"
8
9
10 namespace blobs {
11 namespace world {
12         class Body;
13         class Simulation;
14 }
15 namespace app {
16
17 class MasterState
18 : public State {
19
20 public:
21         MasterState(Assets &, world::Simulation &) noexcept;
22         ~MasterState() noexcept;
23
24         MasterState(const MasterState &) = delete;
25         MasterState &operator =(const MasterState &) = delete;
26
27         MasterState(MasterState &&) = delete;
28         MasterState &operator =(MasterState &&) = delete;
29
30 public:
31         void SetReference(world::Body &r) { reference = &r; }
32
33 private:
34         void OnResize(int w, int h) override;
35
36         void OnUpdate(int dt) override;
37         void OnRender(graphics::Viewport &) override;
38
39         void Tick();
40         int FrameMS() const noexcept;
41
42 private:
43         Assets &assets;
44         world::Simulation ∼
45         world::Body *reference;
46
47         graphics::Camera cam;
48
49         int remain;
50         int thirds;
51
52 };
53
54 }
55 }
56
57 #endif