pebble/lib.rs
1//! A modular, ECS-style graphics/app framework.
2//!
3//! Start with [`prelude`] — `use pebble::prelude::*;` pulls in the types
4//! you need for almost everything below.
5//!
6//! The lifecycle: build an [`app::App`], register [`ecs::plugin::Plugin`]s
7//! (a windowing backend, a graphics backend, your own gameplay plugins),
8//! register systems against an [`app::SystemStage`], then [`app::App::build`]
9//! and [`app::App::run`]. Systems are plain functions whose parameters
10//! (`Res`, `ResMut`, `Query`, `Commands`, ...) declare what ECS state they
11//! touch — see [`ecs::system`] for the full set.
12//!
13//! Assets flow one direction: CPU-side source data goes into
14//! [`assets::storage::Assets`], an [`assets::plugin::AssetPlugin`] uploads
15//! it to a backend via [`assets::upload::Asset::upload`], and the result
16//! lands in [`assets::storage::ProcessedAssets`] for rendering systems to
17//! read. [`assets::handle::Handle`] is the typed handle threaded through
18//! all three.
19//!
20//! [`rendering`] defines the backend-agnostic contract ([`rendering::backend::Backend`],
21//! [`rendering::window::WindowProvider`]); [`wgpu`] is a ready-to-use wgpu
22//! implementation of it, plus a higher-level descriptor-based material/mesh/
23//! texture layer (see [`wgpu::backend::WGPUPlugin`]) that needs far less
24//! boilerplate than implementing `Backend`/`Asset` by hand.
25//!
26//! [`threading::BackgroundTasks`] offloads CPU-bound work to a worker pool;
27//! [`ecs::events`] and [`ecs::system::AsyncExt`] build on it for ECS events
28//! and fire-and-forget async systems.
29
30pub mod app;
31pub mod assets;
32pub mod ecs;
33pub mod prelude;
34pub mod rendering;
35pub mod threading;
36pub mod wgpu;