Byte Engine Docs
View on docs.rs

defaults

Generated Rust API reference for byte_engine.

byte_engine / application / graphics / defaults


Module defaults

Conventional setup components for GraphicsApplication.

default_setup is the batteries-included path used by the triangle example. Applications that replace a subsystem can call the remaining setup functions individually; the window example demonstrates that narrower composition.

Contents

Quick Reference

ItemKindDescription
default_setupfnInstalls the standard assets, input devices, audio worker, visibility rendering pipeline, and window.
setup_default_pipeline_compilationfnStarts the renderer's pending pipeline compiler servers on application-owned threads.
launch_deferred_tasks_threadfnRuns deferred loading tasks on an application-owned asynchronous worker.
build_single_threaded_async_runtimefnCreates the single-threaded runtime used by default background workers.
build_deferred_tasks_queuefnCreates a deferred-task queue sized for the default graphics setup.
setup_default_windowfnCreates the 1920x1080 window used by the default headed setup.
setup_default_resource_and_asset_managementfnIn debug builds, connects the asset directory and standard material, model, image, audio, and standalone-shader handlers to the resource manager.
setup_default_inputfnInstalls the device classes expected by [super::process_default_window_input].
setup_default_audiofnStarts the audio worker, its byte-bounded global sample pool, and the standard audio entity listeners.
setup_animation_poolfnCreates an [AnimationPool] with the given decoded-clip byte budget and spawns its load worker on the application's async runtime.
DeferredTasktypeA loading operation that spawns its work on the provided runtime.
DeferredTaskstypeThe loading operations collected while default subsystems are configured.

Functions

default_setup

fn default_setup(application: &mut super::GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:15-40

Installs the standard assets, input devices, audio worker, visibility rendering pipeline, and window.

After setup, create application actions through GraphicsApplication::action_factory, select scene lighting through crate::gameplay::world::DefaultWorld::factory, and run the application with GraphicsApplication::do_loop.

setup_default_pipeline_compilation

fn setup_default_pipeline_compilation(application: &mut super::GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:47-75

Starts the renderer's pending pipeline compiler servers on application-owned threads.

This setup is idempotent. Call it when composing a graphics application without default_setup before registering pipeline managers or render passes that request asynchronous pipelines.

launch_deferred_tasks_thread

fn launch_deferred_tasks_thread(application: &mut super::GraphicsApplication, tasks: DeferredTasks)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:81-109

Runs deferred loading tasks on an application-owned asynchronous worker.

Build tasks with build_deferred_tasks_queue, then launch the worker after every subsystem has registered its loading work.

build_single_threaded_async_runtime

fn build_single_threaded_async_runtime() -> compio::runtime::Runtime

Defined in crates/byte-engine/src/application/graphics/defaults.rs:112-114

Creates the single-threaded runtime used by default background workers.

build_deferred_tasks_queue

fn build_deferred_tasks_queue() -> DeferredTasks

Defined in crates/byte-engine/src/application/graphics/defaults.rs:126-128

Creates a deferred-task queue sized for the default graphics setup.

Add subsystem loading tasks, then pass the queue to launch_deferred_tasks_thread.

setup_default_window

fn setup_default_window(application: &mut super::GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:131-136

Creates the 1920x1080 window used by the default headed setup.

setup_default_resource_and_asset_management

fn setup_default_resource_and_asset_management(application: &mut super::GraphicsApplication, generator: impl ProgramGenerator + 'static)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:143-223

In debug builds, connects the asset directory and standard material, model, image, audio, and standalone-shader handlers to the resource manager.

Release builds intentionally leave the manager without asset processors and must receive their complete resource store from BELD.

setup_default_input

fn setup_default_input(application: &mut super::GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:238-254

Installs the device classes expected by super::process_default_window_input.

Next, create application-level actions through GraphicsApplication::action_factory. The application tick translates window events and emits their resolved action values.

setup_default_audio

fn setup_default_audio(application: &mut super::GraphicsApplication, spawn_loading_task: impl FnOnce(Box<dyn FnOnce(&compio::runtime::Runtime) + Send>))

Defined in crates/byte-engine/src/application/graphics/defaults.rs:263-336

Starts the audio worker, its byte-bounded global sample pool, and the standard audio entity listeners.

Next, submit a crate::audio::generator::Generator through GraphicsApplication::generator_factory to make it available to the audio worker, or create an crate::audio::graph::AudioGraph through crate::gameplay::world::DefaultWorld::audio_graph_factory.

setup_animation_pool

fn setup_animation_pool(application: &mut super::GraphicsApplication, byte_budget: std::num::NonZeroUsize, spawn_loading_task: impl FnOnce(Box<dyn FnOnce(&compio::runtime::Runtime) + Send>)) -> crate::animation::graph::AnimationPool

Defined in crates/byte-engine/src/application/graphics/defaults.rs:344-358

Creates an AnimationPool with the given decoded-clip byte budget and spawns its load worker on the application's async runtime.

Next, call AnimationPool::update once per tick before advancing graph players that share the pool, then create animation graphs through crate::animation::graph::AnimationGraphPlayer.

Type Aliases

DeferredTask

type DeferredTask = Box<dyn FnOnce(&compio::runtime::Runtime) + Send>;

Defined in crates/byte-engine/src/application/graphics/defaults.rs:117

A loading operation that spawns its work on the provided runtime.

DeferredTasks

type DeferredTasks = Vec<DeferredTask>;

Defined in crates/byte-engine/src/application/graphics/defaults.rs:120

The loading operations collected while default subsystems are configured.

On this page