jump n shoot

This commit is contained in:
2023-08-30 19:13:23 -07:00
parent 7784999da1
commit da6df39feb
2 changed files with 124 additions and 25 deletions

@ -54,6 +54,7 @@ pub trait Example: 'static + Sized {
queue: &wgpu::Queue,
);
fn update(&mut self, event: WindowEvent);
fn move_mouse(&mut self, delta: (f64,f64));
fn render(
&mut self,
view: &wgpu::TextureView,
@ -353,6 +354,15 @@ fn start<E: Example>(
example.update(event);
}
},
event::Event::DeviceEvent {
event:
winit::event::DeviceEvent::MouseMotion {
delta,
},
..
} => {
example.move_mouse(delta);
},
event::Event::RedrawRequested(_) => {
#[cfg(not(target_arch = "wasm32"))]
{