euv-engine 0.12.28

A high-performance 2D game engine built on the euv framework, featuring ECS, fixed-timestep game loop, canvas rendering, physics, collision detection, sprite animation, and audio.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use super::*;

/// A reference-counted, shared-mutable list of asset load callbacks.
///
/// Stores `Closure` objects to prevent them from being dropped prematurely,
/// avoiding memory leaks when registering `onload`/`onerror` handlers.
///
/// Held behind `EngineCell` (an `UnsafeCell`-backed `Sync` newtype)
/// rather than `RefCell` so the storage matches the rest of the
/// engine's `static mut` convention. Access via [`EngineCell::get_mut`]
/// to obtain the underlying `Vec` for push / clear operations.
pub type AssetClosures = Rc<EngineCell<Vec<Closure<dyn FnMut()>>>>;