diff options
Diffstat (limited to 'ui/text.h')
-rw-r--r-- | ui/text.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ui/text.h b/ui/text.h new file mode 100644 index 0000000..81122de --- /dev/null +++ b/ui/text.h @@ -0,0 +1,31 @@ +#pragma once + +#include "uiComponent.h" +#include <GL/glew.h> +#include <glBuffers.h> +#include <glVertexArrays.h> +#include <glm/glm.hpp> +#include <string_view> +#include <vector> + +class UIShader; +union SDL_Event; + +class Text : public UIComponent { +public: + Text(std::string_view s, Position, glm::vec3 colour); + + void render(const UIShader &, const Position & parentPos) const override; + bool handleInput(const SDL_Event &, const Position & parentPos) override; + +private: + struct Model { + Model(GLuint, GLsizei); + GLuint texture; + GLsizei count; + glVertexArray vao; + glBuffer vbo; + }; + std::vector<Model> models; + glm::vec3 colour; +}; |