got everything worked out in the loop. I guess next will be to swap the compute buffer to the image buffer
This commit is contained in:
34
src/main.rs
34
src/main.rs
@@ -15,7 +15,7 @@ use sfml::graphics::{
|
||||
Color, RenderTarget, RenderWindow,
|
||||
};
|
||||
use sfml::system::*;
|
||||
use sfml::window::{Event, Key, Style};
|
||||
use sfml::window::{Key, Style};
|
||||
use sfml::window::mouse::*;
|
||||
use sfml::window::mouse;
|
||||
|
||||
@@ -43,9 +43,10 @@ use vulkano::sync::GpuFuture;
|
||||
use shaderc::CompileOptions;
|
||||
use shade_runner::CompileError;
|
||||
use crate::workpiece::{WorkpieceLoader, Workpiece};
|
||||
use winit::{EventsLoop, WindowBuilder};
|
||||
use winit::{EventsLoop, WindowBuilder, WindowEvent, Event};
|
||||
use vulkano_win::VkSurfaceBuild;
|
||||
|
||||
|
||||
mod slider;
|
||||
mod timer;
|
||||
mod input;
|
||||
@@ -90,6 +91,15 @@ fn main() {
|
||||
|
||||
let mut mouse_xy = Vector2i::new(0,0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let mut s = Box::new(sync::now(processor.device.clone())) as Box<dyn GpuFuture>;
|
||||
|
||||
|
||||
while let Some(p) = window.get_position() {
|
||||
|
||||
// Event::MouseButtonPressed { button, x, y} => {
|
||||
@@ -124,9 +134,25 @@ fn main() {
|
||||
accumulator_time -= step_size;
|
||||
}
|
||||
|
||||
processor.run_loop(&surface);
|
||||
print!("adosfijqwe");
|
||||
let mut exit = false;
|
||||
events_loop.poll_events(|ev| {
|
||||
match ev {
|
||||
Event::WindowEvent { event: WindowEvent::CloseRequested, .. } =>
|
||||
{
|
||||
exit = true;
|
||||
},
|
||||
Event::WindowEvent { event: WindowEvent::Resized(_), .. } => {
|
||||
processor.recreate_swapchain(&surface);
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
});
|
||||
|
||||
if exit {
|
||||
return;
|
||||
}
|
||||
|
||||
s = processor.run(&surface, s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user