1 #ifndef BLOBS_APP_MASTERSTATE_HPP_
2 #define BLOBS_APP_MASTERSTATE_HPP_
7 #include "../graphics/Camera.hpp"
8 #include "../ui/BodyPanel.hpp"
9 #include "../ui/CreaturePanel.hpp"
10 #include "../ui/RecordsPanel.hpp"
11 #include "../ui/TimePanel.hpp"
28 MasterState(Assets &, world::Simulation &) noexcept;
29 ~MasterState() noexcept;
31 MasterState(const MasterState &) = delete;
32 MasterState &operator =(const MasterState &) = delete;
34 MasterState(MasterState &&) = delete;
35 MasterState &operator =(MasterState &&) = delete;
38 void Show(creature::Creature &) noexcept;
39 void Show(world::Body &) noexcept;
41 graphics::Camera &GetCamera() noexcept { return cam; }
42 const graphics::Camera &GetCamera() const noexcept { return cam; }
44 ui::CreaturePanel &GetCreaturePanel() noexcept { return cp; }
45 const ui::CreaturePanel &GetCreaturePanel() const noexcept { return cp; }
47 ui::RecordsPanel &GetRecordsPanel() noexcept { return rp; }
48 const ui::RecordsPanel &GetRecordsPanel() const noexcept { return rp; }
50 ui::TimePanel &GetTimePanel() noexcept { return tp; }
51 const ui::TimePanel &GetTimePanel() const noexcept { return tp; }
54 void OnResize(int w, int h) override;
56 void OnKeyDown(const SDL_KeyboardEvent &) override;
57 void OnMouseDown(const SDL_MouseButtonEvent &) override;
58 void OnMouseUp(const SDL_MouseButtonEvent &) override;
59 void OnMouseMotion(const SDL_MouseMotionEvent &) override;
60 void OnMouseWheel(const SDL_MouseWheelEvent &) override;
62 void OnUpdate(int dt) override;
63 void OnRender(graphics::Viewport &) override;
66 int FrameMS() const noexcept;
70 world::Simulation ∼
74 glm::dvec3 cam_tgt_pos;
76 glm::dvec3 cam_tgt_focus;
78 glm::dvec3 cam_tgt_up;
80 glm::dvec3 cam_orient;
83 creature::Creature *shown_creature;
84 world::Body *shown_body;