Core: use .app local init/deinit/tick events (avoid global events)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
fb37f74d41
commit
2c8ba82aa3
9 changed files with 41 additions and 48 deletions
|
|
@ -36,20 +36,19 @@ frame_render_pass: *gpu.RenderPassEncoder = undefined,
|
|||
pub const name = .app;
|
||||
pub const Mod = mach.Mod(@This());
|
||||
|
||||
pub const global_events = .{
|
||||
pub const local_events = .{
|
||||
.init = .{ .handler = init },
|
||||
.deinit = .{ .handler = deinit },
|
||||
.tick = .{ .handler = tick },
|
||||
};
|
||||
|
||||
pub const local_events = .{
|
||||
.end_frame = .{ .handler = endFrame },
|
||||
};
|
||||
|
||||
fn deinit(
|
||||
core: *mach.Core.Mod,
|
||||
sprite_pipeline: *gfx.SpritePipeline.Mod,
|
||||
) !void {
|
||||
sprite_pipeline.send(.init, .{});
|
||||
core.send(.deinit, .{});
|
||||
}
|
||||
|
||||
fn init(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue