first working prototype of sprite drawing
This commit is contained in:
parent
9aa0d58d68
commit
b317951c32
13 changed files with 386 additions and 36 deletions
|
|
@ -95,6 +95,7 @@ struct Ctx {
|
|||
ushort width, height;
|
||||
Style style;
|
||||
Font font;
|
||||
SpriteAtlas sprite_atlas;
|
||||
|
||||
bool has_focus;
|
||||
struct input {
|
||||
|
|
@ -220,6 +221,7 @@ fn void Ctx.free(&ctx)
|
|||
(void)ctx.cache.free();
|
||||
(void)ctx.cmd_queue.free();
|
||||
(void)ctx.font.free();
|
||||
(void)ctx.sprite_atlas.free();
|
||||
}
|
||||
|
||||
fn void! Ctx.frame_begin(&ctx)
|
||||
|
|
@ -281,6 +283,10 @@ fn void! Ctx.frame_end(&ctx)
|
|||
ctx.push_update_atlas(&ctx.font.atlas)!;
|
||||
ctx.font.should_update = false;
|
||||
}
|
||||
if (ctx.sprite_atlas.should_update) {
|
||||
ctx.push_update_atlas(&ctx.sprite_atlas.atlas)!;
|
||||
ctx.sprite_atlas.should_update = false;
|
||||
}
|
||||
|
||||
$if 1:
|
||||
// draw mouse position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue