wip: engine enhancements and fixes
This commit is contained in:
parent
9816f14f53
commit
cc7921a5fe
27 changed files with 347 additions and 32 deletions
|
|
@ -1,3 +1,10 @@
|
|||
pub mod model_manager;
|
||||
|
||||
pub use crate::model_manager::{ModelManager, ModelManagerRef};
|
||||
|
||||
pub use crate::model_manager::ModelID;
|
||||
#[macro_export]
|
||||
macro_rules! include_shader {
|
||||
($path:expr) => {
|
||||
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../assets/shaders/", $path))
|
||||
};
|
||||
}
|
||||
|
|
@ -1,14 +1,17 @@
|
|||
use std::any::Any;
|
||||
use std::cell::RefCell;
|
||||
use std::path::Path;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::rc::Rc;
|
||||
|
||||
pub type ModelManagerRef = Rc<RefCell<Box<dyn ModelManager>>>;
|
||||
|
||||
pub type ModelID = PathBuf;
|
||||
|
||||
/// The asset manager trait of Raidillon.
|
||||
pub trait ModelManager {
|
||||
pub trait ModelManager: Any {
|
||||
/// 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(&self, id: &ModelID) -> Option<&dyn Any>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue