Add vulkan creation from resources
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 21m47s

This commit is contained in:
Florian RICHER 2025-04-13 18:45:33 +02:00
parent 4f6216635f
commit e2616a0ef5
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
8 changed files with 281 additions and 13 deletions

24
src/core/vulkan/mod.rs Normal file
View file

@ -0,0 +1,24 @@
use context::VulkanContext;
use super::app::App;
mod context;
mod utils;
#[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);
Ok(())
}
}