[][src]Trait rust_webvr_api::vr_display::VRDisplay

pub trait VRDisplay: Send + Sync {
    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); 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) { ... } }

The VRDisplay traits forms the base of all VR device implementations

Required methods

fn id(&self) -> u32

Returns unique device identifier

fn data(&self) -> VRDisplayData

Returns the current display data.

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

Returns gamepads attached to this display

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.

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.

fn reset_pose(&mut self)

Resets the pose for this display

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

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

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

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

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

Loading content...

Provided methods

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.

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

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

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

fn stop_present(&mut self)

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

Loading content...

Trait Implementations

impl PartialEq<dyn VRDisplay + 'static> for dyn VRDisplay[src]

Implementors

Loading content...