Move PlatformContext to the raidillon_platform crate
This commit is contained in:
parent
9905ffd26b
commit
369bbd19c7
8 changed files with 15 additions and 16 deletions
10
platform/src/context.rs
Normal file
10
platform/src/context.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
use winit::event::Event;
|
||||
use raidillon_assets::ModelManagerRef;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct PlatformContext {
|
||||
pub current_event: Event<()>,
|
||||
pub asset_manager: ModelManagerRef,
|
||||
pub frame_width: f32,
|
||||
pub frame_height: f32,
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
pub mod platform;
|
||||
mod camera;
|
||||
mod event;
|
||||
pub mod context;
|
||||
|
||||
pub use platform::Platform;
|
||||
pub use camera::Camera;
|
||||
pub use raidillon_core::context::PlatformContext;
|
||||
pub use context::PlatformContext;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use raidillon_assets::ModelManager;
|
|||
use raidillon_core::engine::EngineTrait;
|
||||
use crate::PlatformContext;
|
||||
|
||||
pub trait Platform<E: EngineTrait> {
|
||||
pub trait Platform<E: EngineTrait<PlatformCtx = PlatformContext>> {
|
||||
/// Initialize platform.
|
||||
fn initialize(engine: E, title: String, width: u32, height: u32) -> Self;
|
||||
fn run(self);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue