blob: 604d0ad700a39d8083ddbe094fbb292bdeda99bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#pragma once
// Credit to https://learnopengl.com/In-Practice/Text-Rendering
#include "font.h"
#include <string>
#include <memory>
enum class AnchorPoint{
TopLeft, TopCenter, TopRight
};
class TextRenderer{
public:
void initialize();
void renderUIText(std::shared_ptr<Font> font, std::string text, glm::vec2 anchorPosition, AnchorPoint anchorPoint, float textBoxWidth, float fontSize, float lineSpacing, glm::vec3 textColor);
private:
GLuint m_vao;
GLuint m_vbo;
};
|