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:
commit
f7d5c14caf
19 changed files with 4391 additions and 0 deletions
1779
raidillon_platform/Cargo.lock
generated
Normal file
1779
raidillon_platform/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
7
raidillon_platform/Cargo.toml
Normal file
7
raidillon_platform/Cargo.toml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[package]
|
||||
name = "raidillon_platform"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
winit = "0.30.12"
|
||||
11
raidillon_platform/src/assets.rs
Normal file
11
raidillon_platform/src/assets.rs
Normal 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);
|
||||
}
|
||||
11
raidillon_platform/src/context.rs
Normal file
11
raidillon_platform/src/context.rs
Normal 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,
|
||||
}
|
||||
11
raidillon_platform/src/event.rs
Normal file
11
raidillon_platform/src/event.rs
Normal 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
|
||||
}
|
||||
7
raidillon_platform/src/lib.rs
Normal file
7
raidillon_platform/src/lib.rs
Normal 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;
|
||||
5
raidillon_platform/src/platform.rs
Normal file
5
raidillon_platform/src/platform.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
pub trait Platform {
|
||||
/// Initialize platform.
|
||||
fn initialize(title: String, width: u32, height: u32) -> Self;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue