update demos et docs

This commit is contained in:
Jérôme Bousquié
2026-09-21 12:01:28 +02:00
parent ef13913464
commit 3dd372410f
11 changed files with 34 additions and 37 deletions
+5 -5
View File
@@ -1,11 +1,11 @@
//! Minimal declarative workflow, no explicit WGPU handling in this file.
//! `AppBuilder` creates the event loop, then `App::run` opens the window, builds the `Context`/`Renderer`
//! and drives the update → render → present loop. Since the winit 0.30 migration, the GPU only exists
//! and drives the update → render → present loop. In winit 0.30 the GPU only exists
//! after `resumed`: that is why shader registration + mesh/material/entity creation live in
//! the `AppHandler::setup` hook, called once the context is ready. Since Step 7 the PipelineCache
//! the `AppHandler::setup` hook, called once the context is ready. The PipelineCache
//! lives in the scene (`Scene::init_gpu`, called in `resumed`): go through `register_shader` +
//! `add_material_shader` + `create_mesh` + `add_entity`, the material being bound to the mesh. Since Step 8
//! (DRAFT 8.4/8.5) the mesh is declared from a **`Geometry`**: per-vertex positions + colors
//! `add_material_shader` + `create_mesh` + `add_entity`, the material being bound to the mesh. The mesh
//! is declared from a **`Geometry`**: per-vertex positions + colors
//! for the unlit quad. The scene renders automatically: the default `render()` method calls
//! `app.render_scene(frame.view())`.
use wsg_lib::AppHandler;
@@ -40,7 +40,7 @@ impl AppHandler for MonQuad {
.with_indices(vec![0, 1, 2, 0, 2, 3]);
// Default material: `None` lets the Scene inject its `standard` at render time
// (`Scene::default_material`, DRAFT Step 7.3.5) — this exercises the default path.
// (`Scene::default_material`) — this exercises the default path.
app.scene.create_mesh("quad_mesh", geometry, None).unwrap();
app.scene.add_entity("quad", "quad_mesh").unwrap();
}