first working prototype of sprite drawing
This commit is contained in:
parent
9aa0d58d68
commit
b317951c32
13 changed files with 386 additions and 36 deletions
|
|
@ -144,7 +144,7 @@ fn Glyph*! Font.get_glyph(&font, Codepoint code)
|
|||
//io::printfn("code=%c, w=%d, h=%d, ox=%d, oy=%d, adv=%d",
|
||||
// glyph.code, glyph.w, glyph.h, glyph.ox, glyph.oy, glyph.adv);
|
||||
|
||||
Point uv = font.atlas.place(pixels, glyph.w, glyph.h)!;
|
||||
Point uv = font.atlas.place(pixels, glyph.w, glyph.h, (ushort)img.width)!;
|
||||
glyph.u = uv.x;
|
||||
glyph.v = uv.y;
|
||||
|
||||
|
|
@ -159,6 +159,7 @@ fn Glyph*! Font.get_glyph(&font, Codepoint code)
|
|||
fn void Font.free(&font)
|
||||
{
|
||||
font.atlas.free();
|
||||
font.table.free();
|
||||
schrift::freefont(font.sft.font);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue