X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=support%2Fcamera.rs;h=8460197f5558dac493376e11d5c4e855faa55665;hb=7b99fbed004ff914c33c2762c8b40c32d7b3a557;hp=69e3bb5388447df98326398edabd3d01f13833e0;hpb=a8aebfadf8f18928b3f8ced81a7f0d4a4421466d;p=mandelwow.git diff --git a/support/camera.rs b/support/camera.rs index 69e3bb5..8460197 100644 --- a/support/camera.rs +++ b/support/camera.rs @@ -1,9 +1,7 @@ -extern crate glutin; - use cgmath::{Matrix4, Vector4}; use cgmath::conv::array4x4; -use glutin::WindowEvent::{KeyboardInput, MouseMoved}; -use glutin::VirtualKeyCode; +use glium; +use glium::glutin::VirtualKeyCode; use std::f32; use std::f32::consts::PI; use support::vec3::Vec3; @@ -165,10 +163,10 @@ impl CameraState { //println!("camera_dir = {:?}", self.dir); } - pub fn process_input(&mut self, event: &glutin::WindowEvent) { + pub fn process_input(&mut self, event: &glium::glutin::WindowEvent) { match event { - &MouseMoved { position: (x, y), .. } => { - let (x, y) = (x as i32, y as i32); + &glium::glutin::WindowEvent::CursorMoved { position, .. } => { + let (x, y) = (position.x as i32, position.y as i32); if self.mouse_x == -1 { // Set initial absolute position. self.mouse_x = x; @@ -179,8 +177,8 @@ impl CameraState { self.mouse_x = x; self.mouse_y = y; } - &KeyboardInput { input, .. } => { - let pressed = input.state == glutin::ElementState::Pressed; + &glium::glutin::WindowEvent::KeyboardInput { input, .. } => { + let pressed = input.state == glium::glutin::ElementState::Pressed; let key = match input.virtual_keycode { Some(key) => key, None => return,