module: event handlers are defined ahead of time
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
0fc3bf6545
commit
3bfafe102d
12 changed files with 1099 additions and 967 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue