This commit is contained in:
Krzosa Karol
2024-08-05 12:45:51 +02:00
parent 3928e2eb96
commit bb2c9a2f32
6 changed files with 8 additions and 2 deletions

View File

@@ -98,7 +98,7 @@ Font CreateFont(Atlas *atlas, int32_t size, String path) {
Font result = {};
result.glyphs.allocator = allocator;
String file = ReadFile(allocator, path);
String file = ReadFile(scratch, path);
if (file.len == 0) {
file = GetDefaultFont(scratch);
Assert(file.len != 0);

View File

@@ -387,7 +387,8 @@ void ReloadFont() {
Atlas atlas = CreateAtlas(scratch, {2048, 2048});
MainFont = CreateFont(&atlas, (uint32_t)size, StyleFont);
{
GLint filter = GL_NEAREST; // GL_LINEAR
GLint filter = GL_NEAREST;
if (StyleFontFilter == 1) filter = GL_LINEAR;
glCreateTextures(GL_TEXTURE_2D, 1, &atlas.texture_id);
glTextureParameteri(atlas.texture_id, GL_TEXTURE_MIN_FILTER, filter);
glTextureParameteri(atlas.texture_id, GL_TEXTURE_MAG_FILTER, filter);