Skip to main content

Crate pebble

Crate pebble 

Source
Expand description

A modular, ECS-style graphics/app framework.

Start with preludeuse pebble::prelude::*; pulls in the types you need for almost everything below.

The lifecycle: build an app::App, register ecs::plugin::Plugins (a windowing backend, a graphics backend, your own gameplay plugins), register systems against an app::SystemStage, then app::App::build and app::App::run. Systems are plain functions whose parameters (Res, ResMut, Query, Commands, …) declare what ECS state they touch — see ecs::system for the full set.

Assets flow one direction: CPU-side source data goes into assets::storage::Assets, an assets::plugin::AssetPlugin uploads it to a backend via assets::upload::Asset::upload, and the result lands in assets::storage::ProcessedAssets for rendering systems to read. assets::handle::Handle is the typed handle threaded through all three.

rendering defines the backend-agnostic contract (rendering::backend::Backend, rendering::window::WindowProvider); wgpu is a ready-to-use wgpu implementation of it, plus a higher-level descriptor-based material/mesh/ texture layer (see wgpu::backend::WGPUPlugin) that needs far less boilerplate than implementing Backend/Asset by hand.

threading::BackgroundTasks offloads CPU-bound work to a worker pool; ecs::events and ecs::system::AsyncExt build on it for ECS events and fire-and-forget async systems.

Modules§

app
assets
The CPU → GPU asset pipeline.
ecs
prelude
use pebble::prelude::*; for the types you need to build an app: App, system params, the asset pipeline, and the backend-agnostic rendering traits. Deliberately an explicit, curated list rather than blanket pub use module::* re-exports (except where noted) — that way a new item added to an internal module doesn’t silently become part of the public prelude surface just by existing.
rendering
threading
A small, fixed-size worker pool for offloading CPU-bound work off the main thread — mip/image processing, physics steps, any one-off or recurring task that shouldn’t block a frame.
wgpu