Move PlatformContext to the raidillon_platform crate

This commit is contained in:
reo 2025-09-22 19:45:30 +03:00
parent 9905ffd26b
commit 369bbd19c7
8 changed files with 15 additions and 16 deletions

View file

@ -1,13 +0,0 @@
use std::cell::RefCell;
use std::rc::Rc;
use std::sync::Arc;
use winit::event::Event;
use raidillon_assets::{ModelManagerRef, ModelManager};
#[derive(Clone)]
pub struct PlatformContext {
pub current_event: Event<()>,
pub asset_manager: ModelManagerRef,
pub frame_width: f32,
pub frame_height: f32,
}

View file

@ -1,14 +1,14 @@
use std::cell::RefCell;
use std::rc::Rc;
use crate::context::PlatformContext;
use crate::DebugUIBuffer;
use crate::scene::Scene;
pub trait EngineTrait {
type PlatformCtx: Clone;
fn new() -> Self;
fn initialize(&mut self, platform_context: PlatformContext);
fn update(&mut self, platform_context: PlatformContext);
fn handle_event(&mut self, platform_context: PlatformContext);
fn initialize(&mut self, platform_context: Self::PlatformCtx);
fn update(&mut self, platform_context: Self::PlatformCtx);
fn handle_event(&mut self, platform_context: Self::PlatformCtx);
fn current_scene_mut(&mut self) -> &mut Scene;
fn get_debug_ui_buffer(&self) -> Rc<RefCell<DebugUIBuffer>>;
fn reset_debug_ui_buffer(&mut self);

View file

@ -1,5 +1,4 @@
pub mod engine;
pub mod scene;
pub mod context;
pub mod debug_ui;
pub use debug_ui::*;