mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
WebVR API Implementation, r=larsbergstrom
This commit is contained in:
parent
13826970c4
commit
c5705bff50
70 changed files with 13044 additions and 20 deletions
24
components/webvr_traits/webvr_traits.rs
Normal file
24
components/webvr_traits/webvr_traits.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use webvr::*;
|
||||
|
||||
pub type WebVRResult<T> = Result<T, String>;
|
||||
|
||||
// Messages from Script thread to WebVR thread.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum WebVRMsg {
|
||||
RegisterContext(PipelineId),
|
||||
UnregisterContext(PipelineId),
|
||||
PollEvents(IpcSender<bool>),
|
||||
GetDisplays(IpcSender<WebVRResult<Vec<VRDisplayData>>>),
|
||||
GetFrameData(PipelineId, u64, f64, f64, IpcSender<WebVRResult<VRFrameData>>),
|
||||
ResetPose(PipelineId, u64, IpcSender<WebVRResult<VRDisplayData>>),
|
||||
RequestPresent(PipelineId, u64, IpcSender<WebVRResult<()>>),
|
||||
ExitPresent(PipelineId, u64, Option<IpcSender<WebVRResult<()>>>),
|
||||
CreateCompositor(u64),
|
||||
Exit,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue