Merge branch '4-window-does-not-close' into 'dev'
Resolve "Window does not close" See merge request Steins7/iv!7
This commit is contained in:
commit
8e7bfc9cdd
@ -55,6 +55,7 @@ where
|
||||
|
||||
let mut input_keys: Vec<Key> = Vec::new();
|
||||
|
||||
loop {
|
||||
for pipeline in &mut self.pipelines {
|
||||
for input in &pipeline.inputs {
|
||||
match input.borrow().read(Duration::from_millis(1)) {
|
||||
@ -75,7 +76,10 @@ where
|
||||
(((x + y)/2.0)/((1280.0 + 720.0)/2.0)) as f32,
|
||||
];
|
||||
},
|
||||
Key::Close => return,
|
||||
Key::Close => {
|
||||
info!("Shutting down IV !");
|
||||
return;
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
@ -110,6 +114,7 @@ where
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
//These tests are disabled because of some stange issue with cargo not waiting for the drop
|
||||
//functions to execute before executing the next test or something like that...
|
||||
|
||||
@ -90,10 +90,7 @@ pub fn run() -> Result<(), &'static str> {
|
||||
|
||||
//running controller
|
||||
let mut controller = Controller::new(vec![subengine_pipeline]);
|
||||
loop {
|
||||
//for _i in 0..40 {
|
||||
controller.run();
|
||||
}
|
||||
|
||||
//let engine_pipelines = vec![
|
||||
// EnginePipeline {
|
||||
|
||||
@ -189,11 +189,11 @@ where
|
||||
|
||||
//println!("Frame nb : {}", self.frames.len());
|
||||
//TODO frames number diminish sometimes at resize...
|
||||
static mut id: i32 = 0;
|
||||
//static mut id: i32 = 0;
|
||||
let mut frame = self.frames.pop_back().unwrap();
|
||||
unsafe {
|
||||
id = (id+1)%3;
|
||||
}
|
||||
//unsafe {
|
||||
// id = (id+1)%3;
|
||||
//}
|
||||
|
||||
trace!("Waiting for Frame...");
|
||||
unsafe {
|
||||
@ -214,9 +214,10 @@ where
|
||||
frame.command_buffer.reset(false); //TODO may be needed at some point...
|
||||
};
|
||||
|
||||
unsafe {
|
||||
trace!("Acquiring Frame {}...", id);
|
||||
}
|
||||
//unsafe {
|
||||
// trace!("Acquiring Frame {}...", id);
|
||||
//}
|
||||
trace!("Acquiring Frame...");
|
||||
let image = unsafe {
|
||||
match self.surface.acquire_image(core::u64::MAX) {
|
||||
Ok((image, suboptimal)) => {
|
||||
@ -228,7 +229,7 @@ where
|
||||
}};
|
||||
|
||||
trace!("Creating Framebuffer...");
|
||||
let mut framebuffer = unsafe {
|
||||
let framebuffer = unsafe {
|
||||
use gfx_hal::device::Device;
|
||||
use std::borrow::Borrow;
|
||||
|
||||
@ -239,15 +240,12 @@ where
|
||||
.unwrap() //TODO improve that
|
||||
};
|
||||
|
||||
unsafe {
|
||||
use gfx_hal::{
|
||||
device::Device,
|
||||
command::CommandBuffer,
|
||||
};
|
||||
//unsafe {
|
||||
// use gfx_hal::{device::Device};
|
||||
|
||||
gpu.device()
|
||||
.set_framebuffer_name(&mut framebuffer, format!("frambuffer {}", id).as_str());
|
||||
}
|
||||
// gpu.device()
|
||||
// .set_framebuffer_name(&mut framebuffer, format!("frambuffer {}", id).as_str());
|
||||
//}
|
||||
|
||||
frame.link_swapchain_image(gpu, image, framebuffer);
|
||||
|
||||
|
||||
@ -98,10 +98,9 @@ where
|
||||
}
|
||||
|
||||
pub fn link_swapchain_image(&mut self,
|
||||
gpu: &Gpu<B>,
|
||||
_gpu: &Gpu<B>, //TODO clear that when framebuffer issue is fixed
|
||||
image: <B::Surface as PresentationSurface<B>>::SwapchainImage,
|
||||
framebuffer: B::Framebuffer) {
|
||||
use gfx_hal::device::Device;
|
||||
|
||||
self.framebuffer = Some(framebuffer);
|
||||
//match self.framebuffer.replace(framebuffer) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user