Brenta Engine 1.1
|
Text subsystem. More...
#include <text.hpp>
Static Public Member Functions | |
static void | init () |
Initialize the text subsystem. | |
static void | load (std::string font_name, unsigned int font_size) |
Load a font. | |
static void | render_text (std::string text, float x, float y, float scale, glm::vec3 color) |
Render text. | |
Static Public Attributes | |
static std::map< char, types::character > | characters |
Map of characters. | |
Text subsystem.
This class is used to render text on the screen. The text is rendered using the FreeType library to load the font and the characters, and OpenGL to render the text on the screen.
|
static |
Initialize the text subsystem.
This method initializes the text subsystem by loading the shader, the VAO, and the VBO. The shader is loaded from the file text.vs and text.fs, and the VAO and VBO are created using the data from the characters map.
Note: opengl context must be created before calling this method.
|
static |
|
static |
Render text.
This method renders the given text on the screen at the given position, with the given scale and color. The text is rendered using the shader, VAO, and VBO that are initialized in the Init method.
text | Text to render |
x | X position of the text |
y | Y position of the text |
scale | Scale of the text |
color | Color of the text |
|
static |