pub struct OpenXrScreenComposer { /* private fields */ }Expand description
Resolves screen geometry and builds its OpenXR composition layer.
§Examples
use ailloli_ui_openxr::{OpenXrResolvedScreenBackend, OpenXrScreenComposer, OpenXrScreenLayerOptions};
let composer = OpenXrScreenComposer::new(OpenXrScreenLayerOptions::default());
assert_eq!(composer.resolve_backend(false), OpenXrResolvedScreenBackend::Flat);Implementations§
Source§impl OpenXrScreenComposer
impl OpenXrScreenComposer
Sourcepub fn new(options: OpenXrScreenLayerOptions) -> Self
pub fn new(options: OpenXrScreenLayerOptions) -> Self
Creates a composer with immutable options.
§Examples
use ailloli_ui_openxr::{OpenXrScreenComposer, OpenXrScreenLayerOptions};
let _: OpenXrScreenComposer = OpenXrScreenComposer::new(OpenXrScreenLayerOptions::default());Sourcepub fn resolve_backend(
&self,
composition_layer_cylinder_supported: bool,
) -> OpenXrResolvedScreenBackend
pub fn resolve_backend( &self, composition_layer_cylinder_supported: bool, ) -> OpenXrResolvedScreenBackend
Resolves the requested surface against cylinder-extension availability.
Explicit Cylinder remains cylinder even when the capability argument is
false; callers must validate that forced choice before submission.
§Examples
use ailloli_ui_openxr::{OpenXrCurvedLayerBackend, OpenXrResolvedScreenBackend, OpenXrScreenComposer, OpenXrScreenLayerOptions, OpenXrScreenSurfaceMode};
let composer = OpenXrScreenComposer::new(OpenXrScreenLayerOptions { surface_mode: OpenXrScreenSurfaceMode::Curved, curved_backend: OpenXrCurvedLayerBackend::Auto, ..Default::default() });
assert_eq!(composer.resolve_backend(true), OpenXrResolvedScreenBackend::Cylinder);
assert_eq!(composer.resolve_backend(false), OpenXrResolvedScreenBackend::Mesh);Sourcepub fn build_layer<'a>(
&self,
reference_space: &'a Space,
swapchain: &'a OpenXrQuadSwapchain,
composition_layer_cylinder_supported: bool,
) -> OpenXrScreenLayer<'a>
pub fn build_layer<'a>( &self, reference_space: &'a Space, swapchain: &'a OpenXrQuadSwapchain, composition_layer_cylinder_supported: bool, ) -> OpenXrScreenLayer<'a>
Builds the resolved borrowed layer for one frame.
Mesh currently uses a quad submission shell; the renderer is responsible
for producing curved imagery in that swapchain.
§Examples
use ailloli_ui_openxr::{OpenXrQuadSwapchain, OpenXrScreenComposer, OpenXrScreenLayer, OpenXrScreenLayerOptions};
fn build<'a>(composer: &OpenXrScreenComposer, space: &'a openxr::Space, swapchain: &'a OpenXrQuadSwapchain) -> OpenXrScreenLayer<'a> {
composer.build_layer(space, swapchain, true)
}Auto Trait Implementations§
impl Freeze for OpenXrScreenComposer
impl RefUnwindSafe for OpenXrScreenComposer
impl Send for OpenXrScreenComposer
impl Sync for OpenXrScreenComposer
impl Unpin for OpenXrScreenComposer
impl UnwindSafe for OpenXrScreenComposer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more