|
| 1 | +# IntelliJ/CLion Run Configurations |
| 2 | + |
| 3 | +This directory contains run configurations for all Kiss3d examples and common development tasks. |
| 4 | + |
| 5 | +## Generated Configurations |
| 6 | + |
| 7 | +### Example Configurations (72 total) |
| 8 | + |
| 9 | +For each of the 36 examples, two run configurations are provided: |
| 10 | + |
| 11 | +1. **Native** - `<example>.run.xml` |
| 12 | + - Runs the example on the native platform |
| 13 | + - Command: `cargo run --package kiss3d --example <name>` |
| 14 | + - Useful for quick testing and debugging |
| 15 | + |
| 16 | +2. **Web (WASM)** - `<example> (web).run.xml` |
| 17 | + - Builds the example for WebAssembly |
| 18 | + - Command: `cargo run --package kiss3d --example <name> --target wasm32-unknown-unknown` |
| 19 | + - Produces `.wasm` files in `target/wasm32-unknown-unknown/` |
| 20 | + |
| 21 | +### Examples List |
| 22 | + |
| 23 | +- add_remove |
| 24 | +- camera |
| 25 | +- cube |
| 26 | +- custom_material |
| 27 | +- custom_mesh |
| 28 | +- custom_mesh_shared |
| 29 | +- decomp |
| 30 | +- event |
| 31 | +- group |
| 32 | +- instancing2d |
| 33 | +- instancing3d |
| 34 | +- lines |
| 35 | +- mouse_events |
| 36 | +- multi_windows |
| 37 | +- obj |
| 38 | +- persistent_point_cloud |
| 39 | +- planar_lines |
| 40 | +- points |
| 41 | +- post_processing |
| 42 | +- primitives |
| 43 | +- primitives2d |
| 44 | +- primitives_scale |
| 45 | +- procedural |
| 46 | +- quad |
| 47 | +- rectangle |
| 48 | +- scene_cycler |
| 49 | +- screenshot |
| 50 | +- stereo |
| 51 | +- text |
| 52 | +- texturing |
| 53 | +- texturing_mipmaps |
| 54 | +- ui |
| 55 | +- window |
| 56 | +- wireframe |
| 57 | + |
| 58 | +### Utility Configurations |
| 59 | + |
| 60 | +- **check.run.xml** - Run `cargo check` on the project |
| 61 | +- **check (wasm).run.xml** - Run `cargo check` for WASM target |
| 62 | +- **clippy.run.xml** - Run Clippy linter |
| 63 | +- **test.run.xml** - Run all tests |
| 64 | + |
| 65 | +## Usage |
| 66 | + |
| 67 | +### In IntelliJ/CLion |
| 68 | + |
| 69 | +1. Open the project in IntelliJ IDEA or CLion |
| 70 | +2. The run configurations will automatically appear in the run configuration dropdown (top-right) |
| 71 | +3. Select any configuration and click Run (▶️) or Debug (🐛) |
| 72 | + |
| 73 | +### Running Examples |
| 74 | + |
| 75 | +#### Native |
| 76 | +- Select `<example>` from the dropdown |
| 77 | +- Click Run to execute the example |
| 78 | +- A window will open showing the 3D scene |
| 79 | + |
| 80 | +#### WASM |
| 81 | +- Select `<example> (web)` from the dropdown |
| 82 | +- Click Run to run for WebAssembly |
| 83 | +- The compiled `.wasm` file will be in `target/wasm32-unknown-unknown/release/examples/` |
| 84 | +- Use a web server to serve the WASM file (see `examples/wasm/` for web setup) |
| 85 | + |
| 86 | +## Configuration Format |
| 87 | + |
| 88 | +Each configuration file follows the IntelliJ Cargo Command Run Configuration format: |
| 89 | + |
| 90 | +```xml |
| 91 | +<component name="ProjectRunConfigurationManager"> |
| 92 | + <configuration default="false" name="<name>" type="CargoCommandRunConfiguration" factoryName="Cargo Command"> |
| 93 | + <option name="command" value="<cargo command>" /> |
| 94 | + <option name="workingDirectory" value="file://$PROJECT_DIR$" /> |
| 95 | + <!-- ... additional options ... --> |
| 96 | + </configuration> |
| 97 | +</component> |
| 98 | +``` |
| 99 | + |
| 100 | +## Regenerating Configurations |
| 101 | + |
| 102 | +If you need to regenerate these configurations (e.g., after adding new examples), you can delete all `.run.xml` files and run the generation script again, or manually create new configuration files following the pattern above. |
| 103 | + |
| 104 | +## Version Control |
| 105 | + |
| 106 | +These files are tracked in git so all team members have the same run configurations available. |
0 commit comments