Skip to main content

Module asset

Module asset 

Source
Expand description

§Asset Pipeline

A comprehensive asset management system for the Proof Engine.

§Overview

The asset pipeline provides a complete lifecycle for all game/engine assets: loading from disk, caching, hot-reloading, dependency tracking, post-processing, and streaming. It is designed to work entirely with std — no external crates.

§Architecture

AssetServer
  ├── AssetRegistry       — type-erased storage of all loaded assets
  ├── AssetCache          — LRU eviction layer
  ├── HotReload           — poll-based file watcher
  ├── StreamingManager    — priority queue for background loads
  └── AssetPack[]         — optional archive bundles

§Usage

use proof_engine::asset::{AssetServer, AssetPath, ImageAsset};

let mut server = AssetServer::new();
let handle = server.load::<ImageAsset>(AssetPath::new("textures/player.png"));
// Later, after the asset is ready:
if let Some(img) = server.get(&handle) {
    println!("{}x{}", img.width, img.height);
}

Structs§

AssetCache
LRU eviction cache that sits on top of AssetRegistry.
AssetDependency
Records which other assets a given asset depends on.
AssetHandle
A strong handle that keeps the underlying asset alive.
AssetId
Opaque numeric identifier for a loaded asset, parameterised by asset type.
AssetManifest
A declarative list of assets to pre-load.
AssetPack
A bundle of multiple asset files stored in a single archive.
AssetPath
A path to an asset, optionally qualified with a sub-asset label.
AssetRegistry
Central type-erased registry that maps numeric IDs to asset slots.
AssetServer
The central asset server: coordinates loading, caching, hot-reload, and streaming.
AssetServerConfig
Configuration for AssetServer.
AssetServerStats
Runtime statistics for the asset server.
AudioNormalizer
Normalises audio samples to the range [-1.0, 1.0].
FontAsset
A loaded font, decomposed into per-glyph data and face metrics.
FontMetrics
Metrics for the whole font face.
GlyphData
Geometry and metrics for a single glyph.
HotReload
Poll-based hot-reload watcher.
ImageAsset
A loaded image — raw decoded pixel data.
ManifestEntry
A single entry in an AssetManifest.
MaterialAsset
A PBR material description.
MeshAsset
A loaded triangle mesh.
MipMapGenerator
Generates box-filtered mip-maps for ImageAsset data.
PlainTextScriptLoader
Loader for plain-text script files.
PlainTextShaderLoader
Loader for plain-text shader source files.
PrefabRef
A reference to a re-usable prefab template.
RawImageLoader
Loader for raw RGBA8 image files.
RawSoundLoader
Loader for raw PCM audio files.
SceneAsset
A complete serialised scene graph.
SceneEntity
A serialised entity in a scene.
ScriptAsset
A raw script source file.
ShaderAsset
A loaded GLSL / WGSL / SPIR-V shader source.
SoundAsset
A loaded audio clip stored as normalised float samples.
StreamRequest
An entry in the streaming queue.
StreamingManager
Priority queue of pending asset loads.
Vertex
A single vertex in a mesh.
WeakHandle
A weak handle that does not prevent the asset from being evicted.

Enums§

LoadState
The current load state of an asset identified by its raw ID.
MaterialParam
Either a constant scalar value or a reference to a texture channel.
OutlineCommand
A single command in a glyph outline path.
PixelFormat
Pixel format for ImageAsset data.
ShaderStage
Which pipeline stage a shader belongs to.
StreamPriority
Priority level for a streaming request.

Traits§

Asset
Marker trait for any type that can be stored as an asset.
AssetLoader
Trait for loading raw bytes into a concrete Asset type.
AssetProcessor
Post-processes an asset after it is first loaded.

Functions§

default_asset_server
Build a default AssetServer with all built-in loaders registered.
load_file_bytes
Load a file synchronously from disk, returning its bytes.