Last active
November 23, 2016 21:12
-
-
Save MortimerGoro/c4cef85672ca5757acaee51fdb5a9e2e to your computer and use it in GitHub Desktop.
VRDevice traits for blogpost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait VRDevice: Send + Sync { | |
// Returns unique device identifier. | |
fn device_id(&self) -> u64; | |
// Returns the current display data. | |
fn display_data(&self) -> VRDisplayData; | |
// Returns the inmediate VRFrameData of the HMD. | |
// Should be used when not presenting to the device. | |
fn inmediate_frame_data(&self, near_z: f64, far_z: f64) -> VRFrameData; | |
// 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 synced_frame_data(&self, next: f64, far_z: f64) -> VRFrameData; | |
// Resets the pose for this display. | |
fn reset_pose(&mut self); | |
// Synchronization point to keep in step with the HMD. | |
// Must be called in the render thread, before doing any work. | |
fn sync_poses(&mut self); | |
// Submits frame to the display. | |
// Must be called in the render thread. | |
fn submit_frame(&mut self, layer: &VRLayer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment