diff options
Diffstat (limited to 'client/src/window.rs')
-rw-r--r-- | client/src/window.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/window.rs b/client/src/window.rs index 72658e5..7da0d74 100644 --- a/client/src/window.rs +++ b/client/src/window.rs @@ -15,7 +15,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ use crate::state::State; -use glam::Vec3; +use glam::{Vec3, vec2}; use log::{info, warn}; use std::net::TcpStream; use winit::{ @@ -96,6 +96,12 @@ impl ApplicationHandler for WindowState { ElementState::Released => -1., }; } + WindowEvent::MouseInput { state, button, .. } => { + sta.click(button, state.is_pressed()); + } + WindowEvent::CursorMoved { position, .. } => { + sta.delta.cursor_pos = vec2(position.x as f32, position.y as f32); + } WindowEvent::CloseRequested => { event_loop.exit(); } |