-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* crates/web-sys/webidls/enabled/WebXRDevice.webidl * Add WebXR Web IDL. * Add WebXr example. * Workaround in WebXR for FrozenArray and XRWebGLLayer constructor. * Remove commented code. * Attempt to improve WebXr example. * Add WebXr as unstable WebIDL. * Fixes for XRWebGLLayer. * Tidy up WebXR example code. * Update WebXr example docs. Co-authored-by: Kev Kirkland <kev.kirkland@elucidata.co.uk>
- Loading branch information
1 parent
3c85ae1
commit 2b29650
Showing
49 changed files
with
3,109 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#![allow(unused_imports)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [ wasm_bindgen ( extends = EventTarget , extends = :: js_sys :: Object , js_name = XR , typescript_type = "XR" ) ] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `Xr` class."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XR)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Xr`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub type Xr; | ||
#[cfg(web_sys_unstable_apis)] | ||
# [ wasm_bindgen ( structural , method , getter , js_class = "XR" , js_name = ondevicechange ) ] | ||
#[doc = "Getter for the `ondevicechange` field of this object."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XR/ondevicechange)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Xr`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn ondevicechange(this: &Xr) -> Option<::js_sys::Function>; | ||
#[cfg(web_sys_unstable_apis)] | ||
# [ wasm_bindgen ( structural , method , setter , js_class = "XR" , js_name = ondevicechange ) ] | ||
#[doc = "Setter for the `ondevicechange` field of this object."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XR/ondevicechange)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Xr`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn set_ondevicechange(this: &Xr, value: Option<&::js_sys::Function>); | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "XrSessionMode")] | ||
# [ wasm_bindgen ( method , structural , js_class = "XR" , js_name = isSessionSupported ) ] | ||
#[doc = "The `isSessionSupported()` method."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XR/isSessionSupported)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Xr`, `XrSessionMode`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn is_session_supported(this: &Xr, mode: XrSessionMode) -> ::js_sys::Promise; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "XrSessionMode")] | ||
# [ wasm_bindgen ( method , structural , js_class = "XR" , js_name = requestSession ) ] | ||
#[doc = "The `requestSession()` method."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XR/requestSession)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Xr`, `XrSessionMode`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn request_session(this: &Xr, mode: XrSessionMode) -> ::js_sys::Promise; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(all(feature = "XrSessionInit", feature = "XrSessionMode",))] | ||
# [ wasm_bindgen ( method , structural , js_class = "XR" , js_name = requestSession ) ] | ||
#[doc = "The `requestSession()` method."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XR/requestSession)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `Xr`, `XrSessionInit`, `XrSessionMode`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn request_session_with_options( | ||
this: &Xr, | ||
mode: XrSessionMode, | ||
options: &XrSessionInit, | ||
) -> ::js_sys::Promise; | ||
} |
29 changes: 29 additions & 0 deletions
29
crates/web-sys/src/features/gen_XrBoundedReferenceSpace.rs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#![allow(unused_imports)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [ wasm_bindgen ( extends = XrReferenceSpace , extends = XrSpace , extends = EventTarget , extends = :: js_sys :: Object , js_name = XRBoundedReferenceSpace , typescript_type = "XRBoundedReferenceSpace" ) ] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `XrBoundedReferenceSpace` class."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRBoundedReferenceSpace)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `XrBoundedReferenceSpace`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub type XrBoundedReferenceSpace; | ||
#[cfg(web_sys_unstable_apis)] | ||
# [ wasm_bindgen ( structural , method , getter , js_class = "XRBoundedReferenceSpace" , js_name = boundsGeometry ) ] | ||
#[doc = "Getter for the `boundsGeometry` field of this object."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRBoundedReferenceSpace/boundsGeometry)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `XrBoundedReferenceSpace`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn bounds_geometry(this: &XrBoundedReferenceSpace) -> ::js_sys::Array; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![allow(unused_imports)] | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
#[doc = "The `XrEye` enum."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `XrEye`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
pub enum XrEye { | ||
None = "none", | ||
Left = "left", | ||
Right = "right", | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#![allow(unused_imports)] | ||
use super::*; | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
extern "C" { | ||
# [ wasm_bindgen ( extends = :: js_sys :: Object , js_name = XRFrame , typescript_type = "XRFrame" ) ] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[doc = "The `XrFrame` class."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `XrFrame`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub type XrFrame; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(feature = "XrSession")] | ||
# [ wasm_bindgen ( structural , method , getter , js_class = "XRFrame" , js_name = session ) ] | ||
#[doc = "Getter for the `session` field of this object."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame/session)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrSession`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn session(this: &XrFrame) -> XrSession; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(all(feature = "XrPose", feature = "XrSpace",))] | ||
# [ wasm_bindgen ( method , structural , js_class = "XRFrame" , js_name = getPose ) ] | ||
#[doc = "The `getPose()` method."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame/getPose)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrPose`, `XrSpace`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn get_pose(this: &XrFrame, space: &XrSpace, base_space: &XrSpace) -> Option<XrPose>; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[cfg(all(feature = "XrReferenceSpace", feature = "XrViewerPose",))] | ||
# [ wasm_bindgen ( method , structural , js_class = "XRFrame" , js_name = getViewerPose ) ] | ||
#[doc = "The `getViewerPose()` method."] | ||
#[doc = ""] | ||
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRFrame/getViewerPose)"] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `XrFrame`, `XrReferenceSpace`, `XrViewerPose`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
pub fn get_viewer_pose( | ||
this: &XrFrame, | ||
reference_space: &XrReferenceSpace, | ||
) -> Option<XrViewerPose>; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![allow(unused_imports)] | ||
use wasm_bindgen::prelude::*; | ||
#[cfg(web_sys_unstable_apis)] | ||
#[wasm_bindgen] | ||
#[doc = "The `XrHandedness` enum."] | ||
#[doc = ""] | ||
#[doc = "*This API requires the following crate features to be activated: `XrHandedness`*"] | ||
#[doc = ""] | ||
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] | ||
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] | ||
#[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
pub enum XrHandedness { | ||
None = "none", | ||
Left = "left", | ||
Right = "right", | ||
} |
Oops, something went wrong.