Function build_callback_source

Source
pub fn build_callback_source<Fa, Fp>(
    size: PhysicalExtent,
    format: TextureFormat,
    acquire: Fa,
    present: Fp,
) -> OpenXrRenderTarget<CallbackImageSource<Fa, Fp>>
where Fa: FnMut() -> OpenXrHostResult<OpenXrImageFrame<FrameToken>> + Send + 'static, Fp: FnMut(FrameToken) -> OpenXrHostResult<()> + Send + 'static,
Expand description

Construct a callback-backed target in one line for host/runtime integrations.

ยงExamples

use ailloli_ui_openxr::{build_callback_source, OpenXrHostResult, OpenXrImageFrame};
use ailloli_ui_render::render_target::PhysicalExtent;
let _target = build_callback_source(
    PhysicalExtent::new(1280, 720),
    wgpu::TextureFormat::Bgra8Unorm,
    || -> OpenXrHostResult<OpenXrImageFrame<u64>> { panic!("host acquires") },
    |_token| Ok(()),
);