- } _ => (),
- }
- if let Event::WindowEvent { event, .. } = event {
- camera.process_input(&event);
- match event {
- WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit,
- WindowEvent::KeyboardInput { input, .. } => {
- if input.state == event::ElementState::Pressed {
- if let Some(key) = input.virtual_keycode {
- match key {
- VirtualKeyCode::Escape | VirtualKeyCode::Q => {
- *control_flow = ControlFlow::Exit;
+ }
+ Event::WindowEvent { event, .. } => {
+ camera.process_input(&event);
+ match event {
+ WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit,
+ WindowEvent::KeyboardInput { input, .. } => {
+ if input.state == event::ElementState::Pressed {
+ if let Some(key) = input.virtual_keycode {
+ match key {
+ VirtualKeyCode::Escape | VirtualKeyCode::Q => {
+ *control_flow = ControlFlow::Exit;
+ }
+ VirtualKeyCode::B => world.bounding_box_enabled ^= true,
+ VirtualKeyCode::P => timer.pause ^= true,
+ VirtualKeyCode::PageUp => timer.t += 0.1,
+ VirtualKeyCode::PageDown => timer.t -= 0.2,
+ VirtualKeyCode::F10 => screenshot::take_screenshot(&display),
+ VirtualKeyCode::F11 | VirtualKeyCode::Return => {
+ fullscreen ^= true;
+ let fs = if fullscreen {
+ let monitor_handle = display.gl_window().window()
+ .available_monitors().next().unwrap();
+ Some(glium::glutin::window::Fullscreen::Borderless(monitor_handle))
+ } else {
+ None
+ };
+ display.gl_window().window().set_fullscreen(fs);
+ }
+ _ => (),