event module contains traits and structs to actually run your game mainloop
and handle top-level state, as well as handle input events such as keyboard
If you don't want to do this, you can write your own mainloop and
get the necessary event machinery by calling
context.sdl_context.event_pump() on your
Context. You can
then call whatever SDL event methods you want on that. This is
not particularly elegant and is not guaranteed to be stable across
different versions of ggez (for instance, we may someday get rid of SDL2),
but trying to wrap it
up more conveniently really ends up with the exact same interface.
eventloop example for an implementation.
An iterator that calls
A handle to access the OS's event pump.
Different event types.
A trait defining event callbacks; your primary interface with
Runs the game's main loop, calling event callbacks on the given state object as events occur.