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);
            }

            WindowEvent::Key(Key::Space, _, Action::Release, _) => {
                log::info!("toggle fullscreen");
                self.toggle_fullscreen()?;
            }

            WindowEvent::Size(_, _) => {
                self.update_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);
            }
            WindowEvent::Key(Key::Space, _, Action::Release, _) => {
                log::info!("toggle fullscreen");
                self.toggle_fullscreen()?;
            }
            WindowEvent::Size(_, _) => {
                self.update_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 ) ; } WindowEvent :: Key ( Key :: Space , _ , Action :: Release , _ ) => { log :: info ! ( " " ) ; self . toggle_fullscreen ( ) ? ; } WindowEvent :: Size ( _ , _ ) => { self . update_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