Skip to main content

web_sys/features/
gen_XrRenderStateInit.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = XRRenderStateInit)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `XrRenderStateInit` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type XrRenderStateInit;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "XrWebGlLayer")]
19    #[doc = "Get the `baseLayer` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`, `XrWebGlLayer`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    #[wasm_bindgen(method, getter = "baseLayer")]
26    pub fn get_base_layer(this: &XrRenderStateInit) -> Option<XrWebGlLayer>;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "XrWebGlLayer")]
29    #[doc = "Change the `baseLayer` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`, `XrWebGlLayer`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "baseLayer")]
36    pub fn set_base_layer(this: &XrRenderStateInit, val: Option<&XrWebGlLayer>);
37    #[cfg(web_sys_unstable_apis)]
38    #[doc = "Get the `depthFar` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
41    #[doc = ""]
42    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
44    #[wasm_bindgen(method, getter = "depthFar")]
45    pub fn get_depth_far(this: &XrRenderStateInit) -> Option<f64>;
46    #[cfg(web_sys_unstable_apis)]
47    #[doc = "Change the `depthFar` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "depthFar")]
54    pub fn set_depth_far(this: &XrRenderStateInit, val: f64);
55    #[cfg(web_sys_unstable_apis)]
56    #[doc = "Get the `depthNear` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
59    #[doc = ""]
60    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62    #[wasm_bindgen(method, getter = "depthNear")]
63    pub fn get_depth_near(this: &XrRenderStateInit) -> Option<f64>;
64    #[cfg(web_sys_unstable_apis)]
65    #[doc = "Change the `depthNear` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
68    #[doc = ""]
69    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, setter = "depthNear")]
72    pub fn set_depth_near(this: &XrRenderStateInit, val: f64);
73    #[cfg(web_sys_unstable_apis)]
74    #[doc = "Get the `inlineVerticalFieldOfView` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
77    #[doc = ""]
78    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    #[wasm_bindgen(method, getter = "inlineVerticalFieldOfView")]
81    pub fn get_inline_vertical_field_of_view(this: &XrRenderStateInit) -> Option<f64>;
82    #[cfg(web_sys_unstable_apis)]
83    #[doc = "Change the `inlineVerticalFieldOfView` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
86    #[doc = ""]
87    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
89    #[wasm_bindgen(method, setter = "inlineVerticalFieldOfView")]
90    pub fn set_inline_vertical_field_of_view(this: &XrRenderStateInit, val: f64);
91    #[cfg(web_sys_unstable_apis)]
92    #[cfg(feature = "XrLayer")]
93    #[doc = "Get the `layers` field of this object."]
94    #[doc = ""]
95    #[doc = "*This API requires the following crate features to be activated: `XrLayer`, `XrRenderStateInit`*"]
96    #[doc = ""]
97    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
98    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
99    #[wasm_bindgen(method, getter = "layers")]
100    pub fn get_layers(this: &XrRenderStateInit) -> Option<::js_sys::Array<XrLayer>>;
101    #[cfg(web_sys_unstable_apis)]
102    #[cfg(feature = "XrLayer")]
103    #[doc = "Change the `layers` field of this object."]
104    #[doc = ""]
105    #[doc = "*This API requires the following crate features to be activated: `XrLayer`, `XrRenderStateInit`*"]
106    #[doc = ""]
107    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
108    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
109    #[wasm_bindgen(method, setter = "layers")]
110    pub fn set_layers(this: &XrRenderStateInit, val: Option<&[XrLayer]>);
111}
112#[cfg(web_sys_unstable_apis)]
113impl XrRenderStateInit {
114    #[doc = "Construct a new `XrRenderStateInit`."]
115    #[doc = ""]
116    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
117    #[doc = ""]
118    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
119    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
120    pub fn new() -> Self {
121        #[allow(unused_mut)]
122        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
123        ret
124    }
125    #[cfg(web_sys_unstable_apis)]
126    #[cfg(feature = "XrWebGlLayer")]
127    #[deprecated = "Use `set_base_layer()` instead."]
128    pub fn base_layer(&mut self, val: Option<&XrWebGlLayer>) -> &mut Self {
129        self.set_base_layer(val);
130        self
131    }
132    #[cfg(web_sys_unstable_apis)]
133    #[deprecated = "Use `set_depth_far()` instead."]
134    pub fn depth_far(&mut self, val: f64) -> &mut Self {
135        self.set_depth_far(val);
136        self
137    }
138    #[cfg(web_sys_unstable_apis)]
139    #[deprecated = "Use `set_depth_near()` instead."]
140    pub fn depth_near(&mut self, val: f64) -> &mut Self {
141        self.set_depth_near(val);
142        self
143    }
144    #[cfg(web_sys_unstable_apis)]
145    #[deprecated = "Use `set_inline_vertical_field_of_view()` instead."]
146    pub fn inline_vertical_field_of_view(&mut self, val: f64) -> &mut Self {
147        self.set_inline_vertical_field_of_view(val);
148        self
149    }
150    #[cfg(web_sys_unstable_apis)]
151    #[cfg(feature = "XrLayer")]
152    #[deprecated = "Use `set_layers()` instead."]
153    pub fn layers(&mut self, val: Option<&[XrLayer]>) -> &mut Self {
154        self.set_layers(val);
155        self
156    }
157}
158#[cfg(web_sys_unstable_apis)]
159impl Default for XrRenderStateInit {
160    fn default() -> Self {
161        Self::new()
162    }
163}