Better lazy event loop + button events + refactoring + serde integration
A new version of the Piston core is released and the ecosystem has been updated.
It is strongly recommended to use event traits to handle events. Use E: GenericEvent in generic code. When following this pattern this update will simply require a version bump in "Cargo.toml".
This release includes the following improvements:
Better lazy event loop
In some application modes that do not require animations, one can save CPU cycles by setting EventSettings::lazy to true. The event loop logic has been changed to a version that behaves better under heavy rendering loads. Instead of rendering on each input event, the event loop now waits for the first event and then polls the event queue empty before rendering. This makes applications more responsive.
The lazy event loop now also got support for benchmark mode. Since most benchmarks are measuring render + updates it is still recommended to disable EventSettings::lazy when measuring game engine performance. An alternative is to use a frame counter.
New button event
You can now read scancodes from the window backend using ButtonEvent. This gives you a struct similar to render and update events. Scancodes are stored inside to preserve equality checks for the enum.