docs: examples README in English (user-facing)

This commit is contained in:
Jérôme Bousquié
2026-09-18 21:11:47 +02:00
parent cc26080ed0
commit a2bd25ecb2
+13 -13
View File
@@ -1,21 +1,21 @@
# Exemples # Examples
Chaque fichier `.rs` de ce répertoire est un **exemple autonome** découvert automatiquement par Cargo Each `.rs` file in this directory is a **standalone example** auto-discovered by Cargo
(`cargo build -p wsg-lib --examples`). Pour lancer un exemple : (`cargo build -p wsg-lib --examples`). To run an example:
```bash ```bash
cargo run -p wsg-lib --example <nom> cargo run -p wsg-lib --example <name>
``` ```
| Exemple | Commande | Description | | Example | Command | Description |
|---------|----------|-------------| |---------|---------|-------------|
| `simple` | `cargo run -p wsg-lib --example simple` | Quad plat unlit (workflow déclaratif minimal, `AppBuilder` + scène auto). | | `simple` | `cargo run -p wsg-lib --example simple` | Flat unlit quad (minimal declarative workflow, `AppBuilder` + auto scene). |
| `cube` | `cargo run -p wsg-lib --example cube` | Cube texturé (damier procédural) éclairé par une lumière directionnelle + une point + une spot. | | `cube` | `cargo run -p wsg-lib --example cube` | Textured cube (procedural checker) lit by a directional + point + spot light. |
| `manual` | `cargo run -p wsg-lib --example manual` | Workflow bas-niveau : `Context`, `Renderer`, `PipelineCache` et `Mesh` directement (pas de façade `App`). | | `manual` | `cargo run -p wsg-lib --example manual` | Low-level workflow: `Context`, `Renderer`, `PipelineCache`, `Mesh` used directly (no `App` facade). |
| `spot_test` | `cargo run -p wsg-lib --example spot_test` | Isolation de la lumière spot : seule une spot est allumée (ambiant quasi nul), cube qui tourne sur deux axes pour bien voir le faisceau orienté. | | `spot_test` | `cargo run -p wsg-lib --example spot_test` | Spot-light isolation: only one spot is on (near-zero ambient), cube rotates on two axes so the oriented beam is clearly visible. |
## Conventions ## Conventions
- Les exemples sont **autonomes** : ils ne chargent aucun asset sur disque (textures procédurales, géométries codées). - Examples are **self-contained**: no assets loaded from disk (procedural textures, hardcoded geometry).
- Ils utilisent le workflow déclaratif (`AppBuilder` + `Scene`) sauf `manual` qui contourne la façade `App`. - They use the declarative workflow (`AppBuilder` + `Scene`) except `manual`, which bypasses the `App` facade.
- Pour ajouter un nouvel exemple : créer un fichier `.rs` dans ce répertoire, le documenter ici, et le référencer dans le README racine si pertinent. - When adding a new example: create a `.rs` file in this directory, document it here, and reference it in the root README if appropriate.