better font atlas implementation

This commit is contained in:
Alessandro Mauri 2024-12-15 21:39:26 +01:00
parent 5a89e9ec7d
commit 6d8300f9d9
7 changed files with 170 additions and 143 deletions

View file

@ -67,6 +67,7 @@ fn void Ctx.free(&ctx)
(void)ctx.tree.free();
(void)ctx.cache.free();
(void)ctx.cmd_queue.free();
(void)ctx.font.free();
}
fn void! Ctx.frame_begin(&ctx)
@ -127,8 +128,14 @@ fn void! Ctx.frame_end(&ctx)
ctx.input.events = (InputEvents)0;
ctx.input.events.force_update = f;
// draw mouse position
// send atlas updates
if (ctx.font.should_update) {
ctx.push_update_atlas(&ctx.font.atlas)!;
ctx.font.should_update = false;
}
$if 1:
// draw mouse position
Cmd cmd = {
.type = CMD_RECT,
.rect.rect = {