vulkano_test/src/core/vulkan/mod.rs
Florian RICHER a04c769438
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 26m40s
Begin add Window Render Context
2025-04-13 19:23:05 +02:00

28 lines
685 B
Rust

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(())
}
}