examples: glyphs: do not use event arguments
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
7ad38d6eff
commit
a065c79200
2 changed files with 4 additions and 6 deletions
|
|
@ -51,7 +51,7 @@ fn init(core: *mach.Core.Mod, sprite_pipeline: *gfx.SpritePipeline.Mod, glyphs:
|
||||||
glyphs.send(.init, .{});
|
glyphs.send(.init, .{});
|
||||||
|
|
||||||
// Prepare which glyphs we will render
|
// Prepare which glyphs we will render
|
||||||
glyphs.send(.prepare, .{&[_]u21{ '?', '!', 'a', 'b', '#', '@', '%', '$', '&', '^', '*', '+', '=', '<', '>', '/', ':', ';', 'Q', '~' }});
|
glyphs.send(.prepare, .{});
|
||||||
|
|
||||||
// Run our init code after glyphs module is initialized.
|
// Run our init code after glyphs module is initialized.
|
||||||
game.send(.after_init, .{});
|
game.send(.after_init, .{});
|
||||||
|
|
|
||||||
|
|
@ -75,15 +75,13 @@ fn init(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare(
|
fn prepare(core: *mach.Core.Mod, glyphs: *Mod) !void {
|
||||||
core: *mach.Core.Mod,
|
|
||||||
glyphs: *Mod,
|
|
||||||
codepoints: []const u21,
|
|
||||||
) !void {
|
|
||||||
const device = core.state().device;
|
const device = core.state().device;
|
||||||
const queue = device.getQueue();
|
const queue = device.getQueue();
|
||||||
var s = glyphs.state();
|
var s = glyphs.state();
|
||||||
|
|
||||||
|
// Prepare which glyphs we will render
|
||||||
|
const codepoints: []const u21 = &[_]u21{ '?', '!', 'a', 'b', '#', '@', '%', '$', '&', '^', '*', '+', '=', '<', '>', '/', ':', ';', 'Q', '~' };
|
||||||
for (codepoints) |codepoint| {
|
for (codepoints) |codepoint| {
|
||||||
const font_size = 48 * 1;
|
const font_size = 48 * 1;
|
||||||
try s.face.setCharSize(font_size * 64, 0, 50, 0);
|
try s.face.setCharSize(font_size * 64, 0, 50, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue