Skip to main content

Crate pebble

Crate pebble 

Source
Expand description

A low-level Rust game engine: an ECS (ecs) plus a wgpu-backed renderer (graphics) and asset pipeline (assets), wired together by app::App. No built-in high-level systems (no scene graph, no physics) — pebble gives you the primitives and stays out of the way.

Start with app::App and ecs::plugin::Plugin.

Modules§

app
assets
ecs
graphics
time

Macros§

asset
Expands to the same AssetSource/Asset<B> impls you’d write by hand — a pure syntax transform, so every built-in asset type keeps using the trait impls directly. Only exists to make a new, user-defined asset type cheaper to write:
bind_comp
Same as bind_mat!, for a ComputePass + Compute instead of a RenderPass + Material.
bind_mat
The “look up, then bind” chain every draw call repeats: $materials.get($handle), then set_pipeline + set_bind_group(0, ...) on $pass. Returns from the enclosing function (via or_return!) if the lookup isn’t ready yet — an asset that hasn’t finished uploading is a normal, common case (a couple frames on load), not a bug.
draw_mesh
Looks up $meshes.get($handle) and draws it — sets the vertex/index buffers and calls draw_indexed, defaulting the instance range to 0..1 (pass a fourth argument for instanced draws). Returns from the enclosing function (via or_return!) if the mesh isn’t ready yet.
or_return
Unwraps an Option, returning from the enclosing function if it’s None — collapses the let Some(x) = expr else { return }; pattern that shows up constantly in systems (which return (), so the ? operator isn’t an option the way it would be in a function returning Option/Result).