From 1f68fe78e84f25c8ddacdc37a293a5de31725bab Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 1 Jan 2022 13:01:08 +0000 Subject: First iteration with font/text support --- ui/text.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 ui/text.h (limited to 'ui/text.h') 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 +#include +#include +#include +#include +#include + +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 models; + glm::vec3 colour; +}; -- cgit v1.2.3