74 lines
3.1 KiB
Rust
74 lines
3.1 KiB
Rust
//! # WSG Library Crate Root
|
|
//!
|
|
//! The top-level entry point for the wsg-lib crate. Exposes eight public modules organized by architectural responsibility:
|
|
//! **app** (App facade + AppBuilder), **handler** (AppHandler trait), **core** (Manager + Executor + geometry types),
|
|
//! **mesh** (geometry sources: primitives + import), **resources** (data types), **pipeline** (shader compilation cache),
|
|
//! **scene** (resource graph and entity management), **prelude** (glob re-exports), and **utils** (configuration and error handling).
|
|
//!
|
|
//! ## Module Interaction Map
|
|
//! - `core` consumes resources from `resources`, pipelines from `pipeline`, and errors from `utils`.
|
|
//! - `scene` aggregates Resources, Materials, and Pipelines into an entity graph.
|
|
//! - `app` orchestrates all subsystems plus the event loop; depends on everything else.
|
|
//! - `handler` defines the user-facing interface consumed by `app`.
|
|
//! - `utils` is a leaf module — no internal dependencies on other library modules.
|
|
//!
|
|
//! ## Top-Level Re-Exports
|
|
//! These are the two primary types users interact with when building applications:
|
|
//! - `App` — high-level application facade wrapping window lifecycle, GPU context, and render automation.
|
|
//! - `AppHandler` — trait users implement to inject game logic into the render loop.
|
|
//!
|
|
//! ## Usage
|
|
//! Consumers import through the re-exports defined in each submodule's `mod.rs`:
|
|
//! ```ignore
|
|
//! use wsg_lib::core::{Context, Renderer};
|
|
//! use wsg_lib::resources::{Mesh, Material, Vertex};
|
|
//! use wsg_lib::utils::STANDARD_SHADER;
|
|
//! ```
|
|
|
|
// Warn if a public API item has no rustdoc comment, keeping API coverage at 100%.
|
|
#![warn(missing_docs)]
|
|
|
|
pub mod app;
|
|
pub mod camera;
|
|
pub mod core;
|
|
pub mod handler;
|
|
pub mod input;
|
|
pub mod lights;
|
|
pub mod mesh;
|
|
pub mod pipeline;
|
|
pub mod prelude;
|
|
pub mod resources;
|
|
pub mod scene;
|
|
pub mod utils;
|
|
|
|
/// Re-export of the high-level application facade for convenient top-level access.
|
|
/// Users create App instances via `AppBuilder`, then call `.run(handler)` to start the application.
|
|
pub use crate::app::App;
|
|
|
|
/// Re-export of the user-defined game logic interface for convenient top-level access.
|
|
/// Users implement this trait to define update/render callbacks injected into the render loop.
|
|
pub use crate::handler::AppHandler;
|
|
|
|
/// Re-export of the shadow mapping configuration for convenient top-level access.
|
|
/// Users tune shadow quality via `AppBuilder::with_shadow_config`.
|
|
pub use crate::core::BloomConfig;
|
|
pub use crate::core::ShadowConfig;
|
|
|
|
/// Re-export of the tone mapping curve selector for convenient top-level access.
|
|
/// Users enable HDR via `AppBuilder::with_hdr(ToneMapper::Aces)`.
|
|
pub use crate::core::ToneMapper;
|
|
|
|
/// Re-export of the MSAA configuration for convenient top-level access.
|
|
/// Users enable MSAA via `AppBuilder::with_msaa(4)`.
|
|
pub use crate::core::MsaaConfig;
|
|
pub use crate::core::{DoFConfig, FogConfig, FogMode};
|
|
|
|
/// Re-export of the geometry data type (positions, normals, UVs, indices).
|
|
pub use crate::core::Geometry;
|
|
|
|
/// Re-export of the per-entity transform (position + rotation + scale).
|
|
pub use crate::core::Transform;
|
|
|
|
/// Re-export of the axis-aligned bounding box.
|
|
pub use crate::core::BBox;
|