core: simplify event iterator
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
8b8489b3e2
commit
09d39fb694
13 changed files with 46 additions and 74 deletions
|
|
@ -71,8 +71,7 @@ fn init(app: *Mod, core: *mach.Core.Mod) !void {
|
|||
}
|
||||
|
||||
fn tick(core: *mach.Core.Mod, app: *Mod) !void {
|
||||
var iter = core.state().pollEvents();
|
||||
while (iter.next()) |event| {
|
||||
while (core.state().nextEvent()) |event| {
|
||||
switch (event) {
|
||||
.close => core.schedule(.exit), // Tell mach.Core to exit the app
|
||||
else => {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue