euv-core 0.46.1

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Viewport-local immediate-mode 2D/framebuffer drawing surface passed to `GameScene::render`.
#[derive(CustomDebug)]
pub struct GameRenderContext<'a> {
    /// Viewport bounds in root logical coordinates.
    pub(crate) bounds: Rect,
    /// Active display list receiving hardware/software/hybrid draw commands.
    #[debug(skip)]
    pub(crate) display_list: &'a mut DisplayList,
    /// Optional same-device GPU texture composite target submitted without CPU pixel readback.
    pub(crate) gpu_composite: Option<GpuCompositeDescriptor>,
}

/// Shared host coordinating a `GameScene`, fixed-timestep `FrameClock`, and `InputState` inside `euv`.
#[derive(Clone, CustomDebug, Data)]
pub struct GameEngineHost {
    /// Fixed-timestep simulation clock.
    pub(crate) clock: Rc<RefCell<FrameClock>>,
    /// Real-time polled input state.
    pub(crate) input: Rc<RefCell<InputState>>,
    /// Hosted game scene implementation.
    #[debug(skip)]
    #[get(skip)]
    pub(crate) scene: Rc<RefCell<dyn GameScene>>,
    /// Mounted viewport canvas `(scene, node)` handles used to gate stepping and auto-dirty visible viewports.
    #[debug(skip)]
    pub(crate) viewport_nodes: Rc<RefCell<Vec<(SceneHandle, NodeId)>>>,
    /// Lifecycle pause flag set when the owning route or component is frozen (`PageRetention::Freeze`).
    #[debug(skip)]
    #[get_mut(skip)]
    #[set(skip)]
    pub(crate) paused: Rc<Cell<bool>>,
}