wip: week of changes
This commit is contained in:
parent
03e8f34dba
commit
176ea52ab0
20 changed files with 171 additions and 47 deletions
|
|
@ -6,3 +6,4 @@ edition = "2024"
|
|||
[dependencies]
|
||||
winit = "0.30.12"
|
||||
raidillon_core = { path = "../raidillon_core" }
|
||||
raidillon_assets = { path = "../raidillon_assets" }
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
use std::path::Path;
|
||||
|
||||
/// The asset manager trait of Raidillon.
|
||||
pub trait AssetManager {
|
||||
type Model;
|
||||
/// Loads a gltf model to VRAM.
|
||||
fn load_gltf(&mut self, path: &Path);
|
||||
/// Unloads the loaded model from VRAM.
|
||||
fn unload_model(&mut self, path: &Path);
|
||||
fn get_model(&mut self, path: &Path) -> &Self::Model;
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
use winit::event::Event;
|
||||
use crate::AssetManager;
|
||||
use raidillon_assets::{ModelManagerRef, ModelManager};
|
||||
|
||||
pub struct PlatformContext<AM: AssetManager> {
|
||||
pub struct PlatformContext {
|
||||
pub current_event: Event<()>,
|
||||
pub asset_manager: AM,
|
||||
pub asset_manager: ModelManagerRef,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
pub mod platform;
|
||||
pub mod assets;
|
||||
pub mod context;
|
||||
|
||||
pub use context::PlatformContext;
|
||||
pub use assets::AssetManager;
|
||||
pub use platform::Platform;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
use raidillon_assets::ModelManager;
|
||||
use raidillon_core::Engine;
|
||||
|
||||
pub trait Platform {
|
||||
/// Initialize platform.
|
||||
fn initialize(title: String, width: u32, height: u32) -> Self;
|
||||
fn run(self, engine: Engine);
|
||||
fn initialize(engine: Engine, title: String, width: u32, height: u32) -> Self;
|
||||
fn run(self);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue