Split crates
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 7m49s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 7m49s
This commit is contained in:
parent
99be029ff8
commit
b977f446d3
16 changed files with 84 additions and 110 deletions
33
crates/engine_vulkan/src/lib.rs
Normal file
33
crates/engine_vulkan/src/lib.rs
Normal file
|
@ -0,0 +1,33 @@
|
|||
use engine_window::raw_handle::WindowWrapper;
|
||||
use vulkan_context::VulkanContext;
|
||||
use window_render_context::WindowRenderContext;
|
||||
|
||||
use bevy_app::{App, Plugin};
|
||||
|
||||
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 VulkanPlugin;
|
||||
|
||||
impl Plugin for VulkanPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
let vulkan_context = VulkanContext::from(app as &App);
|
||||
app.world_mut().insert_resource(vulkan_context);
|
||||
}
|
||||
|
||||
fn ready(&self, app: &App) -> bool {
|
||||
app.world().get_resource::<WindowWrapper>().is_some()
|
||||
}
|
||||
|
||||
fn finish(&self, app: &mut App) {
|
||||
let window_render_context = WindowRenderContext::from(app as &App);
|
||||
app.world_mut().insert_resource(window_render_context);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue