]> git.localhorst.tv Git - blank.git/blob - src/ui/HUD.hpp
245d886e795ffaccf35b658e7fde710457d46d9d
[blank.git] / src / ui / HUD.hpp
1 #ifndef BLANK_UI_HUD_H_
2 #define BLANK_UI_HUD_H_
3
4 #include "../graphics/Texture.hpp"
5 #include "../model/Model.hpp"
6 #include "../model/OutlineModel.hpp"
7 #include "../model/SpriteModel.hpp"
8
9 #include <glm/glm.hpp>
10
11
12 namespace blank {
13
14 class BlendedSprite;
15 class Block;
16 class BlockTypeRegistry;
17 class DirectionalLighting;
18 class Font;
19
20 class HUD {
21
22 public:
23         HUD(const BlockTypeRegistry &, const Font &);
24
25         HUD(const HUD &) = delete;
26         HUD &operator =(const HUD &) = delete;
27
28         void Viewport(float width, float height) noexcept;
29         void Viewport(float x, float y, float width, float height) noexcept;
30
31         void Display(const Block &);
32
33         void Render(DirectionalLighting &, BlendedSprite &) noexcept;
34
35 private:
36         const BlockTypeRegistry &types;
37         const Font &font;
38
39         Model block;
40         Model::Buffer block_buf;
41         glm::mat4 block_transform;
42
43         Texture block_label;
44         SpriteModel label_sprite;
45         glm::mat4 label_transform;
46         SDL_Color label_color;
47
48         bool block_visible;
49
50         OutlineModel crosshair;
51         glm::mat4 crosshair_transform;
52
53         float near, far;
54         glm::mat4 projection;
55         glm::mat4 view;
56
57 };
58
59 }
60
61 #endif