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.
launch_deferred_tasks_threadfnRuns the application's deferred loading tasks and its Loader on one application-owned loading thread.
drive_runtimefnRuns the tasks of runtime until stop returns true, on the thread that entered the runtime.
build_single_threaded_async_runtimefnCreates the single-threaded runtime used by default background workers.
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.
register_default_asset_handlersfnRegisters the standard material, model, image, audio, and standalone-shader handlers on asset_manager.
default_image_processorfnReturns an image processor with GPU mip and environment-map generators, falling back to CPU generation for each one whose GPU setup fails.
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_systemfnCreates the world's animation system from the application's animation parameters.
setup_animation_poolfnCreates an [AnimationPool] with the given decoded-clip byte budget and queues its load worker on the application's loading thread.

Functions

default_setup

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

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

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

After setup, create application actions and select scene lighting through GraphicsApplication::world, then run the application with GraphicsApplication::do_loop.

launch_deferred_tasks_thread

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

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

Runs the application's deferred loading tasks and its Loader on one application-owned loading thread.

Launch the thread after every subsystem has registered its loading work with GraphicsApplication::add_deferred_task. Tasks run in registration order, after the loader starts. Pipelines set up afterwards cannot add loader lanes.

drive_runtime

fn drive_runtime(runtime: &compio::runtime::Runtime, stop: impl FnMut() -> bool)

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

Runs the tasks of runtime until stop returns true, on the thread that entered the runtime.

The loop wakes for ready tasks, finished I/O, and the earliest timer, so timed tasks such as the loader's completion checks run on time. While nothing is ready, it still checks stop at least every 6 ms.

build_single_threaded_async_runtime

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

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

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

setup_default_window

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

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

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 + Clone + 'static)

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

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.

register_default_asset_handlers

fn register_default_asset_handlers(asset_manager: &mut resource_management::asset::manager::AssetManager, generator: impl ProgramGenerator + Clone + 'static, features: crate::rendering::pipelines::visibility::VisibilityFeatures)

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

Registers the standard material, model, image, audio, and standalone-shader handlers on asset_manager.

The debug runtime and BELD both call this, so a baked store and a debug run produce the same resources from the same assets. generator adapts generated material shaders to the renderer, and features removes left-out features from standalone shaders. Every handler that produces images bakes them through the manager's image processor; install default_image_processor with AssetManager::set_image_processor to use the GPU backends.

default_image_processor

fn default_image_processor() -> resource_management::processors::image::ImageProcessor

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

Returns an image processor with GPU mip and environment-map generators, falling back to CPU generation for each one whose GPU setup fails.

Install it with AssetManager::set_image_processor.

setup_default_input

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

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

Installs the device classes expected by super::process_default_window_input.

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

setup_default_audio

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

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

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::audio::graph::AudioGraphFactory.

setup_animation_system

fn setup_animation_system(application: &mut super::GraphicsApplication) -> crate::animation::system::AnimationSystem

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

Creates the world's animation system from the application's animation parameters.

Call before starting the loading thread and creating animators. Next, register graphs with AnimationSystem::register and step the system each frame.

setup_animation_pool

fn setup_animation_pool(application: &mut super::GraphicsApplication, byte_budget: std::num::NonZeroUsize) -> crate::animation::graph::AnimationPool

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

Creates an AnimationPool with the given decoded-clip byte budget and queues its load worker on the application's loading thread.

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

On this page