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(
9 extends = "XrLayer",
10 extends = "EventTarget",
11 extends = "::js_sys::Object",
12 js_name = "XRWebGLLayer",
13 typescript_type = "XRWebGLLayer"
14 )]
15 #[derive(Debug, Clone, PartialEq, Eq)]
16 #[doc = "The `XrWebGlLayer` class."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayer`*"]
21 #[doc = ""]
22 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24 pub type XrWebGlLayer;
25 #[cfg(web_sys_unstable_apis)]
26 #[wasm_bindgen(method, getter, js_class = "XRWebGLLayer", js_name = "antialias")]
27 #[doc = "Getter for the `antialias` field of this object."]
28 #[doc = ""]
29 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/antialias)"]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `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 pub fn antialias(this: &XrWebGlLayer) -> bool;
36 #[cfg(web_sys_unstable_apis)]
37 #[wasm_bindgen(
38 method,
39 getter,
40 js_class = "XRWebGLLayer",
41 js_name = "ignoreDepthValues"
42 )]
43 #[doc = "Getter for the `ignoreDepthValues` field of this object."]
44 #[doc = ""]
45 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/ignoreDepthValues)"]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayer`*"]
48 #[doc = ""]
49 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
51 pub fn ignore_depth_values(this: &XrWebGlLayer) -> bool;
52 #[cfg(web_sys_unstable_apis)]
53 #[wasm_bindgen(method, getter, js_class = "XRWebGLLayer", js_name = "fixedFoveation")]
54 #[doc = "Getter for the `fixedFoveation` field of this object."]
55 #[doc = ""]
56 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/fixedFoveation)"]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayer`*"]
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 pub fn fixed_foveation(this: &XrWebGlLayer) -> Option<f32>;
63 #[cfg(web_sys_unstable_apis)]
64 #[wasm_bindgen(method, setter, js_class = "XRWebGLLayer", js_name = "fixedFoveation")]
65 #[doc = "Setter for the `fixedFoveation` field of this object."]
66 #[doc = ""]
67 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/fixedFoveation)"]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayer`*"]
70 #[doc = ""]
71 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73 pub fn set_fixed_foveation(this: &XrWebGlLayer, value: Option<f32>);
74 #[cfg(web_sys_unstable_apis)]
75 #[cfg(feature = "WebGlFramebuffer")]
76 #[wasm_bindgen(method, getter, js_class = "XRWebGLLayer", js_name = "framebuffer")]
77 #[doc = "Getter for the `framebuffer` field of this object."]
78 #[doc = ""]
79 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/framebuffer)"]
80 #[doc = ""]
81 #[doc = "*This API requires the following crate features to be activated: `WebGlFramebuffer`, `XrWebGlLayer`*"]
82 #[doc = ""]
83 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
84 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
85 pub fn framebuffer(this: &XrWebGlLayer) -> Option<WebGlFramebuffer>;
86 #[cfg(web_sys_unstable_apis)]
87 #[wasm_bindgen(
88 method,
89 getter,
90 js_class = "XRWebGLLayer",
91 js_name = "framebufferWidth"
92 )]
93 #[doc = "Getter for the `framebufferWidth` field of this object."]
94 #[doc = ""]
95 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/framebufferWidth)"]
96 #[doc = ""]
97 #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayer`*"]
98 #[doc = ""]
99 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
100 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
101 pub fn framebuffer_width(this: &XrWebGlLayer) -> u32;
102 #[cfg(web_sys_unstable_apis)]
103 #[wasm_bindgen(
104 method,
105 getter,
106 js_class = "XRWebGLLayer",
107 js_name = "framebufferHeight"
108 )]
109 #[doc = "Getter for the `framebufferHeight` field of this object."]
110 #[doc = ""]
111 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/framebufferHeight)"]
112 #[doc = ""]
113 #[doc = "*This API requires the following crate features to be activated: `XrWebGlLayer`*"]
114 #[doc = ""]
115 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
116 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
117 pub fn framebuffer_height(this: &XrWebGlLayer) -> u32;
118 #[cfg(web_sys_unstable_apis)]
119 #[cfg(all(feature = "WebGlRenderingContext", feature = "XrSession",))]
120 #[wasm_bindgen(catch, constructor, js_class = "XRWebGLLayer")]
121 #[doc = "The `new XrWebGlLayer(..)` constructor, creating a new instance of `XrWebGlLayer`."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/XRWebGLLayer)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `XrSession`, `XrWebGlLayer`*"]
126 #[doc = ""]
127 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
128 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
129 pub fn new_with_web_gl_rendering_context(
130 session: &XrSession,
131 context: &WebGlRenderingContext,
132 ) -> Result<XrWebGlLayer, JsValue>;
133 #[cfg(web_sys_unstable_apis)]
134 #[cfg(all(feature = "WebGl2RenderingContext", feature = "XrSession",))]
135 #[wasm_bindgen(catch, constructor, js_class = "XRWebGLLayer")]
136 #[doc = "The `new XrWebGlLayer(..)` constructor, creating a new instance of `XrWebGlLayer`."]
137 #[doc = ""]
138 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/XRWebGLLayer)"]
139 #[doc = ""]
140 #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `XrSession`, `XrWebGlLayer`*"]
141 #[doc = ""]
142 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
143 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
144 pub fn new_with_web_gl2_rendering_context(
145 session: &XrSession,
146 context: &WebGl2RenderingContext,
147 ) -> Result<XrWebGlLayer, JsValue>;
148 #[cfg(web_sys_unstable_apis)]
149 #[cfg(all(
150 feature = "WebGlRenderingContext",
151 feature = "XrSession",
152 feature = "XrWebGlLayerInit",
153 ))]
154 #[wasm_bindgen(catch, constructor, js_class = "XRWebGLLayer")]
155 #[doc = "The `new XrWebGlLayer(..)` constructor, creating a new instance of `XrWebGlLayer`."]
156 #[doc = ""]
157 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/XRWebGLLayer)"]
158 #[doc = ""]
159 #[doc = "*This API requires the following crate features to be activated: `WebGlRenderingContext`, `XrSession`, `XrWebGlLayer`, `XrWebGlLayerInit`*"]
160 #[doc = ""]
161 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
162 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
163 pub fn new_with_web_gl_rendering_context_and_layer_init(
164 session: &XrSession,
165 context: &WebGlRenderingContext,
166 layer_init: &XrWebGlLayerInit,
167 ) -> Result<XrWebGlLayer, JsValue>;
168 #[cfg(web_sys_unstable_apis)]
169 #[cfg(all(
170 feature = "WebGl2RenderingContext",
171 feature = "XrSession",
172 feature = "XrWebGlLayerInit",
173 ))]
174 #[wasm_bindgen(catch, constructor, js_class = "XRWebGLLayer")]
175 #[doc = "The `new XrWebGlLayer(..)` constructor, creating a new instance of `XrWebGlLayer`."]
176 #[doc = ""]
177 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/XRWebGLLayer)"]
178 #[doc = ""]
179 #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`, `XrSession`, `XrWebGlLayer`, `XrWebGlLayerInit`*"]
180 #[doc = ""]
181 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
182 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
183 pub fn new_with_web_gl2_rendering_context_and_layer_init(
184 session: &XrSession,
185 context: &WebGl2RenderingContext,
186 layer_init: &XrWebGlLayerInit,
187 ) -> Result<XrWebGlLayer, JsValue>;
188 #[cfg(web_sys_unstable_apis)]
189 #[cfg(feature = "XrSession")]
190 #[wasm_bindgen(
191 static_method_of = "XrWebGlLayer",
192 js_class = "XRWebGLLayer",
193 js_name = "getNativeFramebufferScaleFactor"
194 )]
195 #[doc = "The `getNativeFramebufferScaleFactor()` method."]
196 #[doc = ""]
197 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/getNativeFramebufferScaleFactor_static)"]
198 #[doc = ""]
199 #[doc = "*This API requires the following crate features to be activated: `XrSession`, `XrWebGlLayer`*"]
200 #[doc = ""]
201 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
202 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
203 pub fn get_native_framebuffer_scale_factor(session: &XrSession) -> f64;
204 #[cfg(web_sys_unstable_apis)]
205 #[cfg(all(feature = "XrView", feature = "XrViewport",))]
206 #[wasm_bindgen(method, js_class = "XRWebGLLayer", js_name = "getViewport")]
207 #[doc = "The `getViewport()` method."]
208 #[doc = ""]
209 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/XRWebGLLayer/getViewport)"]
210 #[doc = ""]
211 #[doc = "*This API requires the following crate features to be activated: `XrView`, `XrViewport`, `XrWebGlLayer`*"]
212 #[doc = ""]
213 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
214 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
215 pub fn get_viewport(this: &XrWebGlLayer, view: &XrView) -> Option<XrViewport>;
216}