mach: handle exit via module globals
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
f153133c30
commit
85ffb37156
1 changed files with 3 additions and 4 deletions
|
|
@ -11,6 +11,7 @@ pub const module = ecs.Module(.{
|
|||
.globals = struct {
|
||||
core: *Core,
|
||||
device: *gpu.Device,
|
||||
exit: bool,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -36,16 +37,14 @@ pub fn App(comptime modules: anytype) type {
|
|||
}
|
||||
|
||||
pub fn deinit(app: *@This()) void {
|
||||
const core = app.engine.get(.mach, .core);
|
||||
core.deinit();
|
||||
allocator.destroy(core);
|
||||
app.core.deinit();
|
||||
app.engine.deinit();
|
||||
_ = gpa.deinit();
|
||||
}
|
||||
|
||||
pub fn update(app: *@This()) !bool {
|
||||
try app.engine.send(.tick);
|
||||
return false;
|
||||
return app.engine.get(.mach, .exit);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue