Trait VRDisplay

Source
pub trait VRDisplay: Send + Sync {
Show 15 methods // Required methods fn id(&self) -> u32; fn data(&self) -> VRDisplayData; fn fetch_gamepads(&mut self) -> Result<Vec<VRGamepadPtr>, String>; fn immediate_frame_data(&self, near_z: f64, far_z: f64) -> VRFrameData; fn synced_frame_data(&self, next: f64, far_z: f64) -> VRFrameData; fn reset_pose(&mut self); fn sync_poses(&mut self); fn bind_framebuffer(&mut self, index: u32); fn get_framebuffers(&self) -> Vec<VRFramebuffer>; fn render_layer(&mut self, layer: &VRLayer); fn submit_frame(&mut self); // Provided methods fn future_frame_data( &mut self, near_z: f64, far_z: f64, ) -> VRFutureFrameData { ... } fn submit_layer(&mut self, gl: &Gl, layer: &VRLayer) { ... } fn start_present(&mut self, _attributes: Option<VRFramebufferAttributes>) { ... } fn stop_present(&mut self) { ... }
}
Expand description

The VRDisplay traits forms the base of all VR device implementations

Required Methods§

Source

fn id(&self) -> u32

Returns unique device identifier

Source

fn data(&self) -> VRDisplayData

Returns the current display data.

Source

fn fetch_gamepads(&mut self) -> Result<Vec<VRGamepadPtr>, String>

Returns gamepads attached to this display

Source

fn immediate_frame_data(&self, near_z: f64, far_z: f64) -> VRFrameData

Returns the immediate VRFrameData of the HMD Should be used when not presenting to the device.

Source

fn synced_frame_data(&self, next: f64, far_z: f64) -> VRFrameData

👎Deprecated since 0.10.3: please use future_frame_data instead

Returns the synced VRFrameData to render the current frame. Should be used when presenting to the device. sync_poses must have been called before this call.

Source

fn reset_pose(&mut self)

Resets the pose for this display

Source

fn sync_poses(&mut self)

👎Deprecated since 0.10.3: please use future_frame_data instead

Synchronization point to keep in step with the HMD Returns VRFrameData to be used in the next render frame Must be called in the render thread, before doing any work

Source

fn bind_framebuffer(&mut self, index: u32)

Binds the framebuffer to directly render to the HDM Must be called in the render thread, before doing any work

Source

fn get_framebuffers(&self) -> Vec<VRFramebuffer>

Returns the available FBOs that must be used to render to all eyes Must be called in the render thread, before doing any work

Source

fn render_layer(&mut self, layer: &VRLayer)

👎Deprecated since 0.10.3: please use submit_layer instead

Renders a VRLayer from a external texture Must be called in the render thread

Source

fn submit_frame(&mut self)

👎Deprecated since 0.10.3: please use submit_layer instead

Submits frame to the display Must be called in the render thread

Provided Methods§

Source

fn future_frame_data(&mut self, near_z: f64, far_z: f64) -> VRFutureFrameData

Returns the synced VRFrameData to render the next frame. The future that is returned will resolve with frame data when the next frame is available.

Source

fn submit_layer(&mut self, gl: &Gl, layer: &VRLayer)

Renders a VRLayer from an external texture, and submits it to the device. Must be called in the render thread

Source

fn start_present(&mut self, _attributes: Option<VRFramebufferAttributes>)

Hint to indicate that we are going to start sending frames to the device

Source

fn stop_present(&mut self)

Hint to indicate that we are going to stop sending frames to the device

Trait Implementations§

Source§

impl PartialEq for dyn VRDisplay

Source§

fn eq(&self, other: &dyn VRDisplay) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Implementors§