]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/Interface.hpp
display frame counter
[blank.git] / src / ui / Interface.hpp
index 0c140fb88ff40ad18357cd3b42cfce17fbfda5e2..d01fe254a665ed0011c214a97fae7af4b9dbb030 100644 (file)
@@ -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"
 
 namespace blank {
 
+class Assets;
 class Chunk;
+class BlendedSprite;
 class DirectionalLighting;
+class FrameCounter;
 class World;
 
 class Interface {
@@ -31,7 +35,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 &);
@@ -44,6 +48,8 @@ public:
        void FaceBlock();
        void TurnBlock();
 
+       void ToggleCollision();
+
        void PickBlock();
        void PlaceBlock();
        void RemoveBlock() noexcept;
@@ -57,16 +63,21 @@ public:
        void SelectNext();
        void SelectPrevious();
 
+       void ToggleCounter();
+       void UpdateCounter();
+
        void Update(int dt);
 
-       void Render(DirectionalLighting &) noexcept;
+       void Render(DirectionalLighting &, BlendedSprite &) noexcept;
 
 private:
        void CheckAim();
 
 private:
+       const FrameCounter &counter;
        World &world;
        FPSController ctrl;
+       Font font;
        HUD hud;
 
        Ray aim;
@@ -77,6 +88,12 @@ private:
        OutlineModel outline;
        glm::mat4 outline_transform;
 
+       bool show_counter;
+       Texture counter_tex;
+       SpriteModel counter_sprite;
+       glm::mat4 counter_transform;
+       SDL_Color counter_color;
+
        Config config;
 
        IntervalTimer place_timer;