rust_webvr_api/vr_display_capabilities.rs
1/// describes the capabilities of a VRDisplay. These are expected to be static per-device/per-user.
2#[derive(Debug, Clone)]
3#[cfg_attr(feature = "serde-serialization", derive(Deserialize, Serialize))]
4pub struct VRDisplayCapabilities {
5 /// true if the VRDisplay is capable of tracking its position.
6 pub has_position: bool,
7
8 /// true if the VRDisplay is capable of tracking its orientation.
9 pub has_orientation: bool,
10
11 /// true if the VRDisplay is separate from the device’s primary display
12 pub has_external_display: bool,
13
14 /// true if the VRDisplay is capable of presenting content to an HMD or similar device.
15 pub can_present: bool,
16
17 /// true if the VR display expects the browser to present the content.
18 /// This is now deprecated, a better solution is to implement `future_frame_data`
19 /// and have the future resolve when the next animation frame is ready.
20 #[deprecated(since="0.10.3", note="please use `future_frame_data` instead")]
21 pub presented_by_browser: bool,
22
23 /// Indicates the maximum length of the array that requestPresent() will accept,
24 /// Must be 1 if canPresent is true, 0 otherwise.
25 pub max_layers: u64
26}
27
28impl Default for VRDisplayCapabilities {
29 fn default() -> VRDisplayCapabilities {
30 #[allow(deprecated)]
31 VRDisplayCapabilities {
32 has_position: false,
33 has_orientation: false,
34 has_external_display: false,
35 can_present: false,
36 presented_by_browser: false,
37 max_layers: 0
38 }
39 }
40}
41