]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/Interface.hpp
reorganize basic rendering functionality
[blank.git] / src / ui / Interface.hpp
index 88637c6adc368144b9825d411c03729b46cf9ba1..f3b1252643c93f02c8065c347a90ce7229bc3dcb 100644 (file)
 
 namespace blank {
 
-class Chunk;
-class BlendedSprite;
-class DirectionalLighting;
 class Assets;
+class Chunk;
+class FrameCounter;
+class Viewport;
 class World;
 
 class Interface {
@@ -34,7 +34,7 @@ public:
                bool visual_disabled = false;
        };
 
-       Interface(const Config &, const Assets &, World &);
+       Interface(const Config &, const Assets &, const FrameCounter &, World &);
 
        void HandlePress(const SDL_KeyboardEvent &);
        void HandleRelease(const SDL_KeyboardEvent &);
@@ -42,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();
@@ -62,14 +63,18 @@ public:
        void SelectNext();
        void SelectPrevious();
 
+       void ToggleCounter();
+       void UpdateCounter();
+
        void Update(int dt);
 
-       void Render(DirectionalLighting &, BlendedSprite &) noexcept;
+       void Render(Viewport &) noexcept;
 
 private:
        void CheckAim();
 
 private:
+       const FrameCounter &counter;
        World &world;
        FPSController ctrl;
        Font font;
@@ -83,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;