Struct rovr::render::RenderContext
[-] [+]
[src]
pub struct RenderContext<'a> { // some fields omitted }
An active Oculus rendering context associated with an HMD. Only OpenGL is supported. This provides access to the basic metadata necessary to prepare OpenGL framebuffers for drawing.
See hmd.render_to()
for details on use.
Methods
impl<'a> RenderContext<'a>
fn dismiss_hsw(&self)
Dismiss the Health and Safety warning automatically displayed by the Oculus runtime. This should only be dismissed in response to user input; see the Oculus SDK documentation for details on proper usage.
fn recenter_pose(&self)
Recenter the headset, using the current orientation and position as the origin.
fn target_texture_size(&self, eye: &Eye) -> (u32, u32)
Return a (width, height)
tuple containing the suggested size for a render target for the
given eye.
fn projection_matrix(&self, eye: &Eye, near_z: f32, far_z: f32) -> Matrix4
Create an appropriate projection matrix for the given eye. This will properly account for the native field of view of the associated headset. The returned matrix is a right-handed projection with an OpenGL clipping range (-w to w).
fn create_binding(&self, tex_id_left: u32, tex_id_right: u32) -> TextureBinding
Create a texture binding given a pair of OpenGL texture IDs for the left and right eye,
respectively. The left and right textures should be of the size suggested by
target_texture_size
.
Trait Implementations
impl<'a> CreateRenderContext<'a> for RenderContext<'a>
fn new(owning_hmd: &'a Hmd, target: &'a RenderTarget) -> Result<RenderContext<'a>, OculusError>
Create an active Oculus rendering context.