Improve syntax slightly when handling RedrawRequested (#23)
This commit is contained in:
parent
8801bad58a
commit
31225385c7
|
@ -49,15 +49,13 @@ fn main() -> Result<(), Error> {
|
||||||
|
|
||||||
event_loop.run(move |event, _, control_flow| {
|
event_loop.run(move |event, _, control_flow| {
|
||||||
// The one and only event that winit_input_helper doesn't have for us...
|
// The one and only event that winit_input_helper doesn't have for us...
|
||||||
match event {
|
if let Event::WindowEvent {
|
||||||
Event::WindowEvent {
|
event: WindowEvent::RedrawRequested,
|
||||||
event: WindowEvent::RedrawRequested,
|
..
|
||||||
..
|
} = event
|
||||||
} => {
|
{
|
||||||
invaders.draw(pixels.get_frame());
|
invaders.draw(pixels.get_frame());
|
||||||
pixels.render();
|
pixels.render();
|
||||||
}
|
|
||||||
_ => (),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// For everything else, for let winit_input_helper collect events to build its state.
|
// For everything else, for let winit_input_helper collect events to build its state.
|
||||||
|
|
Loading…
Reference in a new issue