use vulkan_context::VulkanContext; use window_render_context::WindowRenderContext; use super::app::App; mod utils; mod vulkan_context; mod window_render_context; #[derive(Debug, thiserror::Error)] pub enum VulkanError { #[error("Failed to create vulkan context")] FailedToCreateVulkanContext, } pub struct Vulkan; impl Vulkan { pub fn new(app: &mut App) -> Result<(), VulkanError> { let vulkan_context = VulkanContext::from(app as &App); app.world_mut().insert_resource(vulkan_context); let window_render_context = WindowRenderContext::from(app as &App); app.world_mut().insert_resource(window_render_context); Ok(()) } }