From a065c79200151274a02fcf5e407707a23664c9a7 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Mon, 29 Apr 2024 21:42:42 -0700 Subject: [PATCH] examples: glyphs: do not use event arguments Signed-off-by: Stephen Gutekanst --- examples/glyphs/App.zig | 2 +- examples/glyphs/Glyphs.zig | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/glyphs/App.zig b/examples/glyphs/App.zig index cded7847..5af2a882 100644 --- a/examples/glyphs/App.zig +++ b/examples/glyphs/App.zig @@ -51,7 +51,7 @@ fn init(core: *mach.Core.Mod, sprite_pipeline: *gfx.SpritePipeline.Mod, glyphs: glyphs.send(.init, .{}); // 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. game.send(.after_init, .{}); diff --git a/examples/glyphs/Glyphs.zig b/examples/glyphs/Glyphs.zig index 430a0f90..bf9a34db 100644 --- a/examples/glyphs/Glyphs.zig +++ b/examples/glyphs/Glyphs.zig @@ -75,15 +75,13 @@ fn init( }); } -fn prepare( - core: *mach.Core.Mod, - glyphs: *Mod, - codepoints: []const u21, -) !void { +fn prepare(core: *mach.Core.Mod, glyphs: *Mod) !void { const device = core.state().device; const queue = device.getQueue(); var s = glyphs.state(); + // Prepare which glyphs we will render + const codepoints: []const u21 = &[_]u21{ '?', '!', 'a', 'b', '#', '@', '%', '$', '&', '^', '*', '+', '=', '<', '>', '/', ':', ';', 'Q', '~' }; for (codepoints) |codepoint| { const font_size = 48 * 1; try s.face.setCharSize(font_size * 64, 0, 50, 0);