Allow webvr thread consumers to request input data

This commit is contained in:
Manish Goregaokar 2019-04-23 10:16:56 -07:00
parent 623507187b
commit c1a8605c3d
4 changed files with 39 additions and 11 deletions

View file

@ -12,7 +12,7 @@ use std::fmt;
use std::num::NonZeroU32;
use std::ops::Deref;
use webrender_api::{DocumentId, ImageKey, PipelineId};
use webvr_traits::WebVRFutureFrameData;
use webvr_traits::WebVRPoseInformation;
/// Helper function that creates a WebGL channel (WebGLSender, WebGLReceiver) to be used in WebGLCommands.
pub use crate::webgl_channel::webgl_channel;
@ -508,9 +508,13 @@ pub enum WebVRCommand {
/// Synchronize the pose information to be used in the frame.
SyncPoses(
WebVRDeviceId,
// near
f64,
// far
f64,
WebGLSender<Result<WebVRFutureFrameData, ()>>,
// sync gamepads too
bool,
WebGLSender<Result<WebVRPoseInformation, ()>>,
),
/// Submit the frame to a VR device using the specified texture coordinates.
SubmitFrame(WebVRDeviceId, [f32; 4], [f32; 4]),