saving working on key entry. going to do pallette now

This commit is contained in:
2019-08-04 19:48:34 -07:00
parent a91e071909
commit cce893a0c8
4 changed files with 96 additions and 177 deletions

View File

@@ -43,7 +43,7 @@ use vulkano::sync::GpuFuture;
use shaderc::CompileOptions;
use shade_runner::CompileError;
use crate::workpiece::{WorkpieceLoader, Workpiece};
use winit::{EventsLoop, WindowBuilder, WindowEvent, Event};
use winit::{EventsLoop, WindowBuilder, WindowEvent, Event, DeviceEvent, VirtualKeyCode, ElementState};
use winit::dpi::LogicalSize;
use vulkano_win::VkSurfaceBuild;
@@ -101,7 +101,7 @@ fn main() {
let mut timer = Timer::new();
let mut input = Input::new();
// let mut input = Input::new();
let step_size: f32 = 0.005;
@@ -156,8 +156,8 @@ fn main() {
}
let mut exit = false;
events_loop.poll_events(|ev| {
match ev {
events_loop.poll_events(|event| {
match event {
Event::WindowEvent { event: WindowEvent::CloseRequested, .. } =>
{
exit = true;
@@ -165,6 +165,17 @@ fn main() {
Event::WindowEvent { event: WindowEvent::Resized(_), .. } => {
processor.recreate_swapchain(&surface);
},
Event::DeviceEvent { event: DeviceEvent::Key(keyboard_input), .. } => {
match keyboard_input.virtual_keycode.unwrap() {
VirtualKeyCode::A => {
if keyboard_input.state == ElementState::Pressed {
processor.save_edges_image();
}
}
_ => ()
}
},
_ => ()
}
});
@@ -173,6 +184,7 @@ fn main() {
return;
}
s = processor.run(&surface, s);
}
}