Add vulkan creation from resources
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 21m47s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 21m47s
This commit is contained in:
parent
4f6216635f
commit
e2616a0ef5
8 changed files with 281 additions and 13 deletions
24
src/core/vulkan/mod.rs
Normal file
24
src/core/vulkan/mod.rs
Normal 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(())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue