Refactor to generalize pipeline drawing sequence

This commit is contained in:
Keavon Chambers
2020-05-23 12:36:47 -07:00
parent 9a60ba54fe
commit a9859b4bb4
18 changed files with 628 additions and 337 deletions
+15 -2
View File
@@ -1,4 +1,4 @@
use super::application::Application;
use crate::application::Application;
use winit::event::*;
use winit::event_loop::ControlFlow;
@@ -30,7 +30,20 @@ pub fn window_event(application: &mut Application, control_flow: &mut ControlFlo
fn keyboard_event(application: &mut Application, control_flow: &mut ControlFlow, input: &KeyboardInput) {
match input {
KeyboardInput { state: ElementState::Pressed, virtual_keycode: Some(VirtualKeyCode::Escape), .. } => quit(control_flow),
KeyboardInput { state: ElementState::Pressed, virtual_keycode: Some(VirtualKeyCode::Space), .. } => application.example(),
KeyboardInput { state: ElementState::Pressed, virtual_keycode: Some(VirtualKeyCode::Space), .. } => {
// const VERTICES: &[[f32; 2]] = &[
// [-0.2, 0.0],
// [0.2, 0.0],
// [0.2, -0.5],
// [-0.2, -0.5],
// ];
// const INDICES: &[u16] = &[
// 0, 1, 2,
// 0, 2, 3,
// ];
// application.example(VERTICES, INDICES);
},
_ => *control_flow = ControlFlow::Wait,
}
}