pub struct GpuAnimationBatch { /* private fields */ }Expand description
Batch of Tween<f32> values evaluated together.
The public API is intentionally small: push tweens, tick the batch, then
read the current values. The CPU fallback preserves exact Tween<f32>
behavior, including delays, looping, and advanced/custom easing.
Implementations§
Source§impl GpuAnimationBatch
impl GpuAnimationBatch
Sourcepub fn new(device: Device, queue: Queue) -> Result<Self, GpuBatchError>
pub fn new(device: Device, queue: Queue) -> Result<Self, GpuBatchError>
Create a batch from an existing wgpu device and queue.
If an unsupported easing is pushed later, backend
reports GpuBackend::Cpu and ticks continue through the exact CPU
fallback path.
Sourcepub fn try_new_auto() -> Result<Self, GpuBatchError>
pub fn try_new_auto() -> Result<Self, GpuBatchError>
Try to create a GPU-backed batch using the default wgpu adapter.
Sourcepub fn new_auto() -> Self
pub fn new_auto() -> Self
Create a GPU-backed batch when possible, otherwise return CPU fallback.
This function never panics because GPU availability is environmental.
Sourcepub fn tick(&mut self, dt: f32)
pub fn tick(&mut self, dt: f32)
Advance every tween by dt seconds and refresh the output buffer.
Sourcepub fn backend(&self) -> GpuBackend
pub fn backend(&self) -> GpuBackend
Currently active backend.
Sourcepub fn shader_source() -> &'static str
pub fn shader_source() -> &'static str
WGSL shader source used by the GPU backend.