Kickstart a new rewrite of the raidillon engine

Endless refactors, refactor everyday, refactor relentlessly, refactor
every morning, every day, every hour.
This commit is contained in:
reo 2025-08-06 11:43:04 +03:00
commit f7d5c14caf
19 changed files with 4391 additions and 0 deletions

1779
raidillon_platform/Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
[package]
name = "raidillon_platform"
version = "0.1.0"
edition = "2024"
[dependencies]
winit = "0.30.12"

View file

@ -0,0 +1,11 @@
use std::path::Path;
pub type ModelHandle = usize;
/// The asset manager trait of Raidillon.
pub trait AssetManager {
/// Loads a gltf model to VRAM.
fn load_gltf(&mut self, path: &Path) -> ModelHandle;
/// Unloads the loaded model from VRAM.
fn unload_model(&mut self, model_handle: ModelHandle);
}

View file

@ -0,0 +1,11 @@
use winit::event::Event;
use crate::AssetManager;
pub struct FrameContext {
pub event: Event<()>,
}
pub struct PlatformContext {
pub frame_context: FrameContext,
pub asset_manager: dyn AssetManager,
}

View file

@ -0,0 +1,11 @@
pub enum PlatformEvent {
/// Emmited when the window should
RedrawRequested,
/// The platform has requested to close the app.
CloseRequested,
/// Platform event loop is about to block and wait for new
/// new events.
AboutToWait
}

View file

@ -0,0 +1,7 @@
pub mod platform;
pub mod assets;
pub mod context;
pub use context::PlatformContext;
pub use assets::AssetManager;
pub use platform::Platform;

View file

@ -0,0 +1,5 @@
pub trait Platform {
/// Initialize platform.
fn initialize(title: String, width: u32, height: u32) -> Self;
}