外观
示例与截图
示例可直接运行:
bash
cargo run --example shapes
cargo run --example text
cargo run --example input
cargo run --example camera
cargo run --example bunnies
cargo run --example audio
cargo run --example features
cargo run --example three_d
cargo run --example async_main
cargo run --example snake| 示例 | 展示内容 |
|---|---|
shapes | 矩形、圆角矩形、圆、线、三角形、旋转、相机、文字 |
text | 多行文本、字号、测量、输入回显 |
input | 键鼠、滚轮、修饰键、鼠标绘制 |
camera | 平移、缩放、旋转、世界层与 HUD 层 |
bunnies | 15000 个精灵的批处理性能演示 |
audio | 程序生成 WAV、Sfx、Music、音频延迟 |
features | Image、纹理过滤、翻转/轴心、椭圆/弧、裁剪、UI、RenderTarget |
three_d | Camera3D、立方体、球体、平面、3D 线段 |
async_main | #[cici::main] + next_frame().await |
snake | 完整贪吃蛇:网格、食物、碰撞、计分、暂停与重开 |
shapes

text

camera
Camera2D 的缩放与旋转,以及屏幕空间的 HUD:

bunnies
15000 个同纹理精灵,通常只需要少量绘制调用:

实际帧率取决于硬件与纹理/覆盖面积。
audio
使用代码生成的 WAV,验证 Sfx 与 Music:

界面会显示音频延迟;示例中实测约 10ms(不同设备不同)。
Web 示例
浏览器端构建见 WebGPU / WASM:
bash
cargo build --release --example web --target wasm32-unknown-unknown