X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2FInterface.hpp;h=f3b1252643c93f02c8065c347a90ce7229bc3dcb;hb=5d2da8a07411ad6417d6ed8d1be997189cf5ce89;hp=a08a0bf5c6a3add3518ea571333bce3e44d6c212;hpb=955fbb45dedb570520fc45d2ce69f420bed2ad08;p=blank.git diff --git a/src/ui/Interface.hpp b/src/ui/Interface.hpp index a08a0bf..f3b1252 100644 --- a/src/ui/Interface.hpp +++ b/src/ui/Interface.hpp @@ -4,6 +4,7 @@ #include "HUD.hpp" #include "../app/FPSController.hpp" #include "../app/IntervalTimer.hpp" +#include "../graphics/Font.hpp" #include "../model/geometry.hpp" #include "../model/OutlineModel.hpp" #include "../world/Block.hpp" @@ -14,8 +15,10 @@ 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,7 +42,8 @@ public: void HandlePress(const SDL_MouseButtonEvent &); void HandleRelease(const SDL_MouseButtonEvent &); void Handle(const SDL_MouseWheelEvent &); - void Handle(const SDL_WindowEvent &) noexcept; + + void Resize(const Viewport &); void FaceBlock(); void TurnBlock(); @@ -59,16 +63,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; @@ -79,6 +88,13 @@ private: OutlineModel outline; glm::mat4 outline_transform; + bool show_counter; + Texture counter_tex; + SpriteModel counter_sprite; + glm::mat4 counter_transform; + float counter_x; + SDL_Color counter_color; + Config config; IntervalTimer place_timer;