better inputs, log config

This commit is contained in:
2019-07-27 16:47:08 +02:00
parent 39b136d799
commit ee01892a22
7 changed files with 289458 additions and 53 deletions

View File

@@ -64,7 +64,7 @@ pub trait Game {
fn update(self: &mut Self, game_data: &mut GameData);
/// Returns true if event should be ignored by the vulkan handler
fn on_window_event(self: &mut Self, game_data: &mut GameData, event: &Event);
fn on_window_event(self: &mut Self, event: &Event);
}
pub struct GameData {
@@ -365,7 +365,7 @@ pub fn init(mesh_path: &str, line_vertices: Vec<LinePoint>, game: &mut dyn Game)
// wait would happen. Blocking may be the desired behavior, but if you don't want to
// block you should spawn a separate thread dedicated to submissions.
events_loop.poll_events(|ev| {
game.on_window_event(&mut data, &ev);
game.on_window_event(&ev);
match ev {
Event::WindowEvent { event: WindowEvent::CloseRequested, .. } => data.shutdown = true,
Event::WindowEvent { event: WindowEvent::Resized(_), .. } => recreate_swapchain = true,