raidillon/asset/src/model_manager.rs
2025-08-30 12:55:42 +03:00

17 lines
504 B
Rust

use std::any::Any;
use std::cell::RefCell;
use std::path::{Path, PathBuf};
use std::rc::Rc;
pub type ModelManagerRef = Rc<RefCell<Box<dyn ModelManager>>>;
pub type ModelID = &'static str;
/// The asset manager trait of Raidillon.
pub trait ModelManager: Any {
/// Loads a gltf model to VRAM.
fn load_gltf(&mut self, id: ModelID, path: &Path);
/// Unloads the loaded model from VRAM.
fn unload_model(&mut self, id: ModelID);
fn get_model(&self, id: &ModelID) -> Option<&dyn Any>;
}