[−][src]Struct openxr::FrameStream
Handle for managing frame presentation
Example
let state = frame_stream.wait().unwrap(); let (view_flags, views) = session .locate_views(state.predicted_display_time, world_space) .unwrap(); let status = frame_stream.begin().unwrap(); if status != openxr::sys::Result::SESSION_VISIBILITY_UNAVAILABLE { // draw views... } frame_stream .end( state.predicted_display_time, openxr::EnvironmentBlendMode::OPAQUE, &[&openxr::CompositionLayerProjection::new() .space(world_space) .views(&[ openxr::CompositionLayerProjectionView::new() .pose(views[0].pose) .fov(views[0].fov) .sub_image( openxr::SwapchainSubImage::new() .swapchain(swapchain) .image_array_index(0) .image_rect(openxr::Rect2Di { offset: openxr::Offset2Di { x: 0, y: 0 }, extent: view_resolution[0], }), ), openxr::CompositionLayerProjectionView::new() .pose(views[1].pose) .fov(views[1].fov) .sub_image( openxr::SwapchainSubImage::new() .swapchain(swapchain) .image_array_index(1) .image_rect(openxr::Rect2Di { offset: openxr::Offset2Di { x: 0, y: 0 }, extent: view_resolution[1], }), ), ])], ) .unwrap();
Methods
impl<G: Graphics> FrameStream<G>
[src]
pub fn wait(&mut self) -> Result<FrameState>
[src]
Block until rendering should begin
pub fn begin(&mut self) -> Result<Result>
[src]
Indicate that graphics device work is beginning
pub fn end(
&mut self,
display_time: Time,
environment_blend_mode: EnvironmentBlendMode,
layers: &[&CompositionLayerBase<G>]
) -> Result<()>
[src]
&mut self,
display_time: Time,
environment_blend_mode: EnvironmentBlendMode,
layers: &[&CompositionLayerBase<G>]
) -> Result<()>
Indicate that all graphics work for the frame has been submitted
layers
is an array of references to any type of composition layer,
e.g. CompositionLayerProjection
.
Auto Trait Implementations
impl<G> Send for FrameStream<G> where
G: Send,
G: Send,
impl<G> Sync for FrameStream<G> where
G: Sync,
G: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,