X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FMasterState.hpp;h=24a29e696463e960918708f1be4151e4429b2de7;hb=dd8b3145a03ed676b0ae6311c29fc3d68f666b15;hp=fb245cb62b2afb9e080cdd272e75e992a632508c;hpb=be413456f57da06e918ae7bf4c4f35e5198ff7ce;p=blobs.git diff --git a/src/app/MasterState.hpp b/src/app/MasterState.hpp index fb245cb..24a29e6 100644 --- a/src/app/MasterState.hpp +++ b/src/app/MasterState.hpp @@ -5,6 +5,7 @@ #include "Assets.hpp" #include "../graphics/Camera.hpp" +#include "../ui/CreaturePanel.hpp" namespace blobs { @@ -28,11 +29,21 @@ public: MasterState &operator =(MasterState &&) = delete; public: - void SetReference(world::Body &r) { reference = &r; } + graphics::Camera &GetCamera() noexcept { return cam; } + const graphics::Camera &GetCamera() const noexcept { return cam; } + + ui::CreaturePanel &GetCreaturePanel() noexcept { return cp; } + const ui::CreaturePanel &GetCreaturePanel() const noexcept { return cp; } private: void OnResize(int w, int h) override; + void OnKeyDown(const SDL_KeyboardEvent &) override; + void OnMouseDown(const SDL_MouseButtonEvent &) override; + void OnMouseUp(const SDL_MouseButtonEvent &) override; + void OnMouseMotion(const SDL_MouseMotionEvent &) override; + void OnMouseWheel(const SDL_MouseWheelEvent &) override; + void OnUpdate(int dt) override; void OnRender(graphics::Viewport &) override; @@ -42,12 +53,18 @@ private: private: Assets &assets; world::Simulation ∼ - world::Body *reference; graphics::Camera cam; + double cam_dist; + double cam_tgt_dist; + glm::dvec3 cam_orient; + bool cam_dragging; + + ui::CreaturePanel cp; int remain; int thirds; + bool paused; };