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
|
|
@ -110,12 +110,9 @@ fn tick(
|
|||
glyphs: *Glyphs.Mod,
|
||||
app: *Mod,
|
||||
) !void {
|
||||
// TODO(important): event polling should occur in mach.Core module and get fired as ECS events.
|
||||
// TODO(Core)
|
||||
var iter = core.state().pollEvents();
|
||||
var direction = app.state().direction;
|
||||
var spawning = app.state().spawning;
|
||||
while (iter.next()) |event| {
|
||||
while (core.state().nextEvent()) |event| {
|
||||
switch (event) {
|
||||
.key_press => |ev| {
|
||||
switch (ev.key) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue