Files
wsg/lib/src/scene/mod.rs
T
Jérôme Bousquié 3a424afe8c GPU culling
2026-09-22 15:48:15 +02:00

25 lines
1.3 KiB
Rust

//! # Scene Module — Resource Depot and Entity Graph
//!
//! Defines `Scene`, the repository for resources (Mesh, Material) and the graph of entity associations between them.
//! Scene is the declarative layer of the architecture: users register Meshes and Materials by identifier before
//! the render loop starts, then associate entities via labels during initialization. At runtime, Scene provides
//! immutable access to these resources without exposing raw wgpu handles.
//!
//! ## Interaction with Other Modules
//! - **core**: Renderer queries Scene for Material/Mesh pairs to draw; Context does not interact directly.
//! - **pipeline**: PipelineCache creates Materials keyed by shader_id; Scene stores references to those Materials.
//! - **resources**: Scene owns Mesh and Material instances; Vertex is only used at Mesh creation time.
//! - **utils**: Scene uses WsgError if resource registration fails.
//!
//! ## Architecture Note
//! Per ARCHI_APP_FACADE.md, Scene is one half of the "App" facade pattern. It enables a declarative workflow where
//! all resources are declared before the render loop begins, while keeping the freedom to build the engine
//! "brick by brick" through direct Context/PipelineCache/Renderer manipulation.
pub mod entity;
pub mod scene;
// Re-export
pub use entity::Entity;
pub use scene::{Scene, SlotDraw};