summaryrefslogtreecommitdiff
path: root/ui/text.h
blob: cbe49de09eaf5b02e3992aa7f3d1a8d0bbe14c78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include "uiComponent.h"
#include <GL/glew.h>
#include <glArrays.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;
};