restructuring

This commit is contained in:
Krzosa Karol
2025-12-14 10:32:42 +01:00
parent 0424ca62f2
commit a351d2eb41
20 changed files with 1076 additions and 1043 deletions

View File

@@ -388,7 +388,7 @@ GLuint UploadAtlas(Atlas *atlas) {
return tex;
}
void ReloadFont() {
void ReloadFont(String path, U32 size) {
if (PrimaryFont.texture_id) {
glDeleteTextures(1, &PrimaryFont.texture_id);
Dealloc(&PrimaryFont.glyphs);
@@ -397,7 +397,7 @@ void ReloadFont() {
Scratch scratch;
Atlas atlas = CreateAtlas(scratch, {2048, 2048});
PrimaryFont = CreateFont(&atlas, (uint32_t)ClampBottom(2u, (U32)StyleFontSize), StyleFont);
SecondaryFont = CreateFont(&atlas, 12, StyleFont);
PrimaryFont = CreateFont(&atlas, (uint32_t)ClampBottom(2u, (U32)size), path);
SecondaryFont = CreateFont(&atlas, 12, path);
SecondaryFont.texture_id = PrimaryFont.texture_id = UploadAtlas(&atlas);
}