optimised font texture sizes

This commit is contained in:
Jay Robson 2024-01-24 18:49:00 +11:00
parent a4e10a8e39
commit 6d895d62b3
2 changed files with 4 additions and 8 deletions

View File

@ -40,7 +40,7 @@ void font::init()
return;
}
int size = 1024;
int size = 256;
float m = 1.0f / size;
FT_Set_Pixel_Sizes(face, 0, size);

View File

@ -75,13 +75,13 @@ void window::create()
MeshScene.load_model("../assets", "scene.obj");
glm::mat4 mat = glm::mat4(1);
mat = glm::translate(mat, glm::vec3(-2.949, -1.7778, 3));
mat = glm::translate(mat, glm::vec3(-2.949, -1.7778 + 0.05, 3 - 0.05));
mat = glm::rotate(mat, glm::radians<float>(-90), glm::vec3(1, 0, 0));
mat = glm::rotate(mat, glm::radians<float>(-90), glm::vec3(0, 1, 0));
MeshText.model_matrix = mat;
MeshText.colour_matrix = {
1, 0, 0, 1,
1, 1, 1, 1,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0
@ -93,16 +93,12 @@ void window::create()
void window::loop()
{
MeshText.bind();
font::generate(MeshText, "Hello, World!\nThis is cool!\n=)", 0.2);
font::generate(MeshText, "Hello, World!\nThis is cool!\n=)", 0.1);
glClearColor(0, 0, 0, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
camera::update();
double mouse_x, mouse_y;
mouse::get(mouse_x, mouse_y);
glm::mat4 mat_projection = glm::perspective(glm::radians(90.0f), 1.0f, 0.01f, 20.f);
glUniformMatrix4fv(shader::gl_projection, 1, false, &mat_projection[0][0]);