Start README

This commit is contained in:
2024-02-16 13:28:23 -05:00
parent 9406a9d429
commit 7a7e73a829
3 changed files with 18 additions and 4 deletions

View File

@@ -41,7 +41,10 @@ namespace JGL
FT_Face face;
FT_Library ft;
using namespace J3ML;
bool InitTextEngine() {
constexpr u32 default_font_size = 16;
if (FT_Init_FreeType(&ft))
{
std::cout << "Error::FREETYPE: " << std::endl;
@@ -53,7 +56,7 @@ namespace JGL
std::cout << "Error::FREETYPE: Failed to load font!" << std::endl;
return false;
}
FT_Set_Pixel_Sizes(face, 0, 48);
FT_Set_Pixel_Sizes(face, 0, default_font_size);
return true;
}
@@ -71,7 +74,7 @@ namespace JGL
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, g->bitmap.width, g->bitmap.rows, 0, GL_RED, GL_UNSIGNED_BYTE, g->bitmap.buffer);
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, g->bitmap.width, g->bitmap.rows, 0, GL_ALPHA, GL_UNSIGNED_BYTE, g->bitmap.buffer);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);