re-org en App

This commit is contained in:
Jérôme Bousquié
2026-07-07 16:42:37 +02:00
parent cfd8b421a2
commit 82ea16d118
28 changed files with 518 additions and 67 deletions
+20
View File
@@ -0,0 +1,20 @@
# Scene Module — Resource Depot and Entity Graph
## Overview
The `scene` module defines Scene, the declarative layer of the WSG architecture. Users register resources (Meshes, Materials) by identifier before the render loop starts, then associate entities via labels. At runtime, Scene provides immutable access to these resources without exposing raw wgpu handles.
| File | Responsibility |
|------|---------------|
| **scene** | Scene struct — resource depot storing Meshes and Materials keyed by string identifiers, plus entity graph mapping labels to (mesh_id, material_id) pairs for rendering iteration. |
## Interaction with Other Modules
- **core::renderer**: Renderer queries Scene for Material/Mesh pairs during frame rendering; Context does not interact directly.
- **pipeline**: PipelineCache creates Materials keyed by shader_id; Scene stores references to those Materials.
- **resources**: Scene owns Arc<Mesh> and Arc<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.