]> git.localhorst.tv Git - blobs.git/blob - src/app/MasterState.hpp
more orbits and stuff
[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 OnKeyDown(const SDL_KeyboardEvent &) override;
37
38         void OnUpdate(int dt) override;
39         void OnRender(graphics::Viewport &) override;
40
41         void Tick();
42         int FrameMS() const noexcept;
43
44 private:
45         Assets &assets;
46         world::Simulation ∼
47         world::Body *reference;
48
49         graphics::Camera cam;
50
51         int remain;
52         int thirds;
53         bool paused;
54
55 };
56
57 }
58 }
59
60 #endif