3#include "../rendering/vao.h"
4#include "../rendering/window.h"
5#include "../rendering/texture.h"
6#include "shaderProgram.h"
88 float minValue,
float maxValue,
float value);
98 HUD_TEXT*
NewHUDText(std::string name, glm::vec2 position, glm::vec2 scale,
float rotation, std::string textContent, glm::vec3 colour);
137 void LoadFont(
const char* filePath,
int fontSize);
141 int windowWidth, windowHeight;
150 std::vector<HUD_IMAGE*> hudImageElements;
151 std::vector<HUD_PROGRESS_BAR*> hudBarElements;
152 std::vector<HUD_TEXT*> hudTextElements;
156 unsigned int TextureID;
159 unsigned int Advance;
162 std::map<char, Character> Characters;
Class to render HUD elements on the screen.
Definition hud.h:15
HUD(Window *window)
Definition hud.cpp:18
void LoadFont(const char *filePath, int fontSize)
Definition hud.cpp:321
HUD_TEXT * GetHUDTextByName(const std::string &name)
Definition hud.cpp:137
HUD_IMAGE * NewHUDImage(std::string name, glm::vec2 position, glm::vec2 scale, float rotation, Texture *texture)
Definition hud.cpp:52
HUD_IMAGE * GetHUDImageByName(const std::string &name)
Definition hud.cpp:119
void RemoveHUDImage(HUD_IMAGE *imageToRemove)
Definition hud.cpp:146
HUD_TEXT * NewHUDText(std::string name, glm::vec2 position, glm::vec2 scale, float rotation, std::string textContent, glm::vec3 colour)
Definition hud.cpp:102
~HUD()=default
HUD manager destructor.
HUD_PROGRESS_BAR * GetHUDProgressBarByName(const std::string &name)
Definition hud.cpp:128
void RemoveHUDText(HUD_TEXT *textToRemove)
Definition hud.cpp:160
HUD_PROGRESS_BAR * NewHUDProgressBar(std::string name, glm::vec2 position, glm::vec2 scale, float rotation, Texture *underTexture, Texture *progressTexture, float minValue, float maxValue, float value)
Definition hud.cpp:71
void RemoveHUDProgressBar(HUD_PROGRESS_BAR *progressBarToRemove)
Definition hud.cpp:153
void Render()
Renders all active HUD elements.
Definition hud.cpp:167
A linked OpenGL program.
Definition shaderProgram.h:16
Texture base class.
Definition texture.h:20
float rotation
Rotation of the image, in radians.
Definition hud.h:26
std::string name
Name of the HUD element.
Definition hud.h:21
bool active
Flag to indicate if currently active.
Definition hud.h:22
Texture * texture
Texture to display.
Definition hud.h:23
glm::vec2 scale
Scale of the image.
Definition hud.h:25
glm::vec2 position
2D position in screen coordinates
Definition hud.h:24
Texture * progressTexture
Texxture rendered on the progress bar, according to current progress value.
Definition hud.h:36
float value
Current value of the progress bar.
Definition hud.h:43
float minValue
Minimum value for the progress bar.
Definition hud.h:41
float rotation
Rotation of the progress bar, in radians.
Definition hud.h:39
glm::vec2 position
2D position in screen coordinates
Definition hud.h:37
bool active
Flag to indicate if currently active.
Definition hud.h:34
std::string name
Name of the HUD element.
Definition hud.h:33
glm::vec2 scale
Scale of the progress bar.
Definition hud.h:38
float maxValue
Maximum value for the progress bar.
Definition hud.h:42
Texture * underTexture
Textured rendere underneath the progress bar.
Definition hud.h:35
Class to display text on the screen.
Definition hud.h:47
std::string name
Name of the HUD element.
Definition hud.h:49
glm::vec2 position
2D position in screen coordinates
Definition hud.h:51
float rotation
Rotation of the text, in radians.
Definition hud.h:53
bool active
Flag to indicate if currently active.
Definition hud.h:50
glm::vec3 colour
Colour of the text, in RGB.
Definition hud.h:55
glm::vec2 scale
Scale of the text.
Definition hud.h:52
std::string textContent
The text string to be displayed.
Definition hud.h:54