X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2FInterface.hpp;h=d6c301981ef45125ac10cbf7a4eeabd7b987dbe6;hb=50f35affb16c78bd3d0b420f5ba37d74fcac391f;hp=0c140fb88ff40ad18357cd3b42cfce17fbfda5e2;hpb=b7d09e1e35ef90282c97509e0020b20db3c7ea9f;p=blank.git diff --git a/src/ui/Interface.hpp b/src/ui/Interface.hpp index 0c140fb..d6c3019 100644 --- a/src/ui/Interface.hpp +++ b/src/ui/Interface.hpp @@ -4,18 +4,21 @@ #include "HUD.hpp" #include "../app/FPSController.hpp" #include "../app/IntervalTimer.hpp" +#include "../graphics/Font.hpp" +#include "../graphics/Text.hpp" #include "../model/geometry.hpp" #include "../model/OutlineModel.hpp" #include "../world/Block.hpp" -#include #include namespace blank { +class Assets; class Chunk; -class DirectionalLighting; +class FrameCounter; +class Viewport; class World; class Interface { @@ -31,7 +34,7 @@ public: bool visual_disabled = false; }; - Interface(const Config &, World &); + Interface(const Config &, const Assets &, const FrameCounter &, World &); void HandlePress(const SDL_KeyboardEvent &); void HandleRelease(const SDL_KeyboardEvent &); @@ -39,11 +42,12 @@ public: void HandlePress(const SDL_MouseButtonEvent &); void HandleRelease(const SDL_MouseButtonEvent &); void Handle(const SDL_MouseWheelEvent &); - void Handle(const SDL_WindowEvent &) noexcept; void FaceBlock(); void TurnBlock(); + void ToggleCollision(); + void PickBlock(); void PlaceBlock(); void RemoveBlock() noexcept; @@ -57,16 +61,21 @@ public: void SelectNext(); void SelectPrevious(); + void ToggleCounter(); + void UpdateCounter(); + void Update(int dt); - void Render(DirectionalLighting &) noexcept; + void Render(Viewport &) noexcept; private: void CheckAim(); private: + const FrameCounter &counter; World &world; FPSController ctrl; + Font font; HUD hud; Ray aim; @@ -77,6 +86,8 @@ private: OutlineModel outline; glm::mat4 outline_transform; + Text counter_text; + Config config; IntervalTimer place_timer;