module: event handlers are defined ahead of time

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-03-24 17:31:12 -07:00 committed by Stephen Gutekanst
parent 0fc3bf6545
commit 3bfafe102d
12 changed files with 1099 additions and 967 deletions

View file

@ -44,6 +44,12 @@ const d0 = 0.000001;
pub const name = .game;
pub const Mod = mach.Mod(@This());
pub const events = .{
.{ .global = .init, .handler = init },
.{ .global = .deinit, .handler = deinit },
.{ .global = .tick, .handler = tick },
};
pub const Pipeline = enum(u32) {
default,
};
@ -58,7 +64,7 @@ const text1: []const []const u8 = &.{
const text2: []const []const u8 = &.{"!$?😊"};
pub fn init(
fn init(
engine: *mach.Engine.Mod,
text_mod: *Text.Mod,
game: *Mod,
@ -122,11 +128,11 @@ pub fn init(
};
}
pub fn deinit(engine: *mach.Engine.Mod) !void {
fn deinit(engine: *mach.Engine.Mod) !void {
_ = engine;
}
pub fn tick(
fn tick(
engine: *mach.Engine.Mod,
text_mod: *Text.Mod,
game: *Mod,