fn handle_event(&mut self, event: glfw::WindowEvent) -> Result<()> {
        use glfw::{Action, Key, WindowEvent};
        match event {
            WindowEvent::Key(Key::Escape, _, Action::Press, _) => {
                self.window_surface.window.set_should_close(true);
            }
            _ => {}
        }

        if default_camera_controls(&mut self.camera, &event) {
            self.graphics
                .get_layer_mut(&self.world_layer)
                .set_projection(self.camera.as_matrix());
            let projection = self.ui_projection();
            self.graphics
                .get_layer_mut(&self.ui_layer)
                .set_projection(projection);
        }

        Ok(())
    }
/// Handle window events and update the application state as needed.
Handle window events and update the application state as needed.
Handle window events and update the application state as needed .
fn handle_event(&mut self, event: glfw::WindowEvent) -> Result<()> {
        use glfw::{Action, Key, WindowEvent};
        match event {
            WindowEvent::Key(Key::Escape, _, Action::Press, _) => {
                self.window_surface.window.set_should_close(true);
            }
            _ => {}
        }
        if default_camera_controls(&mut self.camera, &event) {
            self.graphics
                .get_layer_mut(&self.world_layer)
                .set_projection(self.camera.as_matrix());
            let projection = self.ui_projection();
            self.graphics
                .get_layer_mut(&self.ui_layer)
                .set_projection(projection);
        }
        Ok(())
    }
fn handle_event ( & mut self , event : glfw :: WindowEvent ) -> Result < ( ) > { use glfw :: { Action , Key , WindowEvent } ; match event { WindowEvent :: Key ( Key :: Escape , _ , Action :: Press , _ ) => { self . window_surface . window . set_should_close ( true ) ; } _ => { } } if default_camera_controls ( & mut self . camera , & event ) { self . graphics . get_layer_mut ( & self . world_layer ) . set_projection ( self . camera . as_matrix ( ) ) ; let projection = self . ui_projection ( ) ; self . graphics . get_layer_mut ( & self . ui_layer ) . set_projection ( projection ) ; } Ok ( ( ) ) }
Handle window events and update the application state as needed.
Handle window events and update the application state as needed .
&mut self
event
glfw::WindowEvent