PGR Copakond OpenGL Engine - Bowling
Loading...
Searching...
No Matches
textLabel.h
Go to the documentation of this file.
1#ifndef PGR_SEM_COPAKOND_TextLabel_H
2#define PGR_SEM_COPAKOND_TextLabel_H
3
4#include "../mesh.h"
6
7namespace copakond {
9 class TextLabel : public Mesh {
10 private:
11 static std::string _alphabet;
12
13 std::string _text;
14 int _numCharacters;
15
16 std::vector<float> _uvs;
17 std::vector<float> _normals;
18
19 GLuint _vboUvs = 0;
20
22 void _generateGeometry();
23
24 public:
25 TextLabel(const std::string& fontImagePath);
26 TextLabel(const std::string& fontImagePath, std::shared_ptr<Material> material);
27 ~TextLabel() override;
28
33 void setText(const std::string& text);
34 void setColor(const glm::vec3 &color) const;
35
37 void init(GLuint shader) override;
38 void draw(float deltaTime) override;
39 };
40}
41
42#endif //PGR_SEM_COPAKOND_TextLabel_H
Mesh()
Definition mesh.cpp:12
~TextLabel() override
Definition textLabel.cpp:29
void setText(const std::string &text)
Updates the displayed text string and regenerates mesh geometry.
Definition textLabel.cpp:33
void setColor(const glm::vec3 &color) const
Definition textLabel.cpp:38
TextLabel(const std::string &fontImagePath)
Definition textLabel.cpp:10
PGR Semestral work with sample scenes and bowling. doxygen was generated with a help of LLM.
Definition bezier.cpp:3
Shader * shader
Definition main.cpp:37
void init()
Initializes OpenGL context, scene data, and sets up GLUT callbacks.
Definition main.cpp:42
void draw()
Main render loop. Handles updates, physics, and rendering of all scene elements.
Definition main.cpp:97