use ecs::World; use ui::prelude::*; use vulkan_rs::prelude::*; use crate::Result; use std::sync::Arc; use crate::prelude::*; pub trait TScene: Send + Sync { fn process( &mut self, buffer_recorder: &mut CommandBufferRecorder<'_>, images: &TargetMode>>, indices: &TargetMode, ) -> Result<()>; fn resize( &mut self, window_width: f32, window_height: f32, images: &TargetMode>>, ) -> Result<()>; } pub trait PostProcess: Send + Sync { /// higher priority means, it is executed earlier fn priority(&self) -> u32; fn process( &self, buffer_recorder: &mut CommandBufferRecorder<'_>, indices: &TargetMode, ) -> Result<()>; fn resize(&self, width: u32, height: u32, images: &TargetMode>>) -> Result<()>; } pub trait RenderCore: std::fmt::Debug + Send + Sync { fn next_frame(&mut self, world: &mut World) -> Result; fn resize(&mut self, world: &mut World, w: u32, h: u32) -> Result<()>; fn format(&self) -> VkFormat; fn image_layout(&self) -> VkImageLayout { VK_IMAGE_LAYOUT_PRESENT_SRC_KHR } fn set_clear_color(&self, color: [f32; 4]); // post process handling fn add_post_processing_routine(&self, post_process: Arc); fn remove_post_processing_routine(&self, post_process: Arc); fn clear_post_processing_routines(&self); // getter fn image_count(&self) -> usize; fn images(&self) -> TargetMode>>; fn width(&self) -> u32; fn height(&self) -> u32; fn transformations(&self) -> Option<(VRTransformations, VRTransformations)>; }