#ifndef BLANK_UI_HUD_H_
#define BLANK_UI_HUD_H_
-#include "../model/Model.hpp"
+#include "FixedText.hpp"
+#include "MessageBox.hpp"
+#include "../model/EntityModel.hpp"
#include "../model/OutlineModel.hpp"
#include <glm/glm.hpp>
class Block;
class BlockTypeRegistry;
-class DirectionalLighting;
+class Config;
+class Environment;
+class Font;
+class Player;
+class Viewport;
class HUD {
public:
- explicit HUD(const BlockTypeRegistry &);
+ explicit HUD(Environment &, Config &, const Player &);
HUD(const HUD &) = delete;
HUD &operator =(const HUD &) = delete;
- void Viewport(float width, float height) noexcept;
- void Viewport(float x, float y, float width, float height) noexcept;
+ // focus
+ void FocusBlock(const Chunk &, int);
+ void FocusEntity(const Entity &);
+ void FocusNone();
- void Display(const Block &);
+ // "inventory"
+ void DisplayNone();
+ void Display(const BlockType &);
- void Render(DirectionalLighting &) noexcept;
+ // debug overlay
+ void UpdateDebug();
+ void UpdateCounter();
+ void UpdatePosition();
+ void UpdateOrientation();
-private:
- const BlockTypeRegistry &types;
+ // message box
+ void PostMessage(const char *);
+ void PostMessage(const std::string &msg) {
+ PostMessage(msg.c_str());
+ }
+
+ void Update(int dt);
+ void Render(Viewport &) noexcept;
- Model block;
- Model::Buffer block_buf;
+private:
+ Environment &env;
+ Config &config;
+ const Player &player;
+
+ // block focus
+ OutlineModel outline;
+ glm::mat4 outline_transform;
+ bool outline_visible;
+
+ // "inventory"
+ EntityModel block;
+ EntityModel::Buffer block_buf;
glm::mat4 block_transform;
+ FixedText block_label;
bool block_visible;
- OutlineModel crosshair;
- glm::mat4 crosshair_transform;
+ // debug overlay
+ FixedText counter_text;
+ FixedText position_text;
+ FixedText orientation_text;
+ FixedText block_text;
+ FixedText entity_text;
+ bool show_block;
+ bool show_entity;
+
+ // message box
+ MessageBox messages;
+ IntervalTimer msg_timer;
- float near, far;
- glm::mat4 projection;
- glm::mat4 view;
+ // crosshair
+ OutlineModel crosshair;
};