Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/modules/openxr/doc_classes/OpenXRAPIExtension.xml
22517 views
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<class name="OpenXRAPIExtension" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
3
<brief_description>
4
Makes the OpenXR API available for GDExtension.
5
</brief_description>
6
<description>
7
[OpenXRAPIExtension] makes OpenXR available for GDExtension. It provides the OpenXR API to GDExtension through the [method get_instance_proc_addr] method, and the OpenXR instance through [method get_instance].
8
It also provides methods for querying the status of OpenXR initialization, and helper methods for ease of use of the API with GDExtension.
9
</description>
10
<tutorials>
11
<link title="XrResult documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html</link>
12
<link title="XrInstance documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html</link>
13
<link title="XrSpace documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html</link>
14
<link title="XrSession documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html</link>
15
<link title="XrSystemId documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html</link>
16
<link title="xrBeginSession documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html</link>
17
<link title="XrPosef documentation">https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html</link>
18
</tutorials>
19
<methods>
20
<method name="action_get_handle">
21
<return type="int" />
22
<param index="0" name="action" type="RID" />
23
<description>
24
Returns the corresponding [code]XrAction[/code] OpenXR handle for the given action RID.
25
</description>
26
</method>
27
<method name="begin_debug_label_region">
28
<return type="void" />
29
<param index="0" name="label_name" type="String" />
30
<description>
31
Begins a new debug label region, this label will be reported in debug messages for any calls following this until [method end_debug_label_region] is called. Debug labels can be stacked.
32
</description>
33
</method>
34
<method name="can_render">
35
<return type="bool" />
36
<description>
37
Returns [code]true[/code] if OpenXR is initialized for rendering with an XR viewport.
38
</description>
39
</method>
40
<method name="end_debug_label_region">
41
<return type="void" />
42
<description>
43
Marks the end of a debug label region. Removes the latest debug label region added by calling [method begin_debug_label_region].
44
</description>
45
</method>
46
<method name="find_action">
47
<return type="RID" />
48
<param index="0" name="name" type="String" />
49
<param index="1" name="action_set" type="RID" />
50
<description>
51
Returns the [RID] corresponding to an [code]Action[/code] of a matching name, optionally limited to a specified action set.
52
</description>
53
</method>
54
<method name="get_error_string">
55
<return type="String" />
56
<param index="0" name="result" type="int" />
57
<description>
58
Returns an error string for the given [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url].
59
</description>
60
</method>
61
<method name="get_hand_tracker">
62
<return type="int" />
63
<param index="0" name="hand_index" type="int" />
64
<description>
65
Returns the corresponding [code]XRHandTrackerEXT[/code] handle for the given hand index value.
66
</description>
67
</method>
68
<method name="get_instance">
69
<return type="int" />
70
<description>
71
Returns the [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html]XrInstance[/url] created during the initialization of the OpenXR API.
72
</description>
73
</method>
74
<method name="get_instance_proc_addr">
75
<return type="int" />
76
<param index="0" name="name" type="String" />
77
<description>
78
Returns the function pointer of the OpenXR function with the specified name, cast to an integer. If the function with the given name does not exist, the method returns [code]0[/code].
79
[b]Note:[/b] [code]openxr/util.h[/code] contains utility macros for acquiring OpenXR functions, e.g. [code]GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)[/code].
80
</description>
81
</method>
82
<method name="get_next_frame_time">
83
<return type="int" />
84
<description>
85
Returns the predicted display timing for the next frame.
86
</description>
87
</method>
88
<method name="get_openxr_version">
89
<return type="int" />
90
<description>
91
Returns the version of OpenXR that was initialized. Only valid after the OpenXR instance has been created. See [url=https://registry.khronos.org/OpenXR/specs/1.1/html/xrspec.html#XR_MAKE_VERSION]XR_MAKE_VERSION[/url] for how the version is calculated.
92
</description>
93
</method>
94
<method name="get_play_space">
95
<return type="int" />
96
<description>
97
Returns the play space, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html]XrSpace[/url] cast to an integer.
98
</description>
99
</method>
100
<method name="get_predicted_display_time">
101
<return type="int" />
102
<description>
103
Returns the predicted display timing for the current frame.
104
</description>
105
</method>
106
<method name="get_projection_layer">
107
<return type="int" />
108
<description>
109
Returns a pointer to the render state's [code]XrCompositionLayerProjection[/code] struct.
110
[b]Note:[/b] This method should only be called from the rendering thread.
111
</description>
112
</method>
113
<method name="get_render_state_z_far">
114
<return type="float" />
115
<description>
116
Returns the far boundary value of the camera frustum.
117
[b]Note:[/b] This is only accessible in the render thread.
118
</description>
119
</method>
120
<method name="get_render_state_z_near">
121
<return type="float" />
122
<description>
123
Returns the near boundary value of the camera frustum.
124
[b]Note:[/b] This is only accessible in the render thread.
125
</description>
126
</method>
127
<method name="get_session">
128
<return type="int" />
129
<description>
130
Returns the OpenXR session, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html]XrSession[/url] cast to an integer.
131
</description>
132
</method>
133
<method name="get_supported_swapchain_formats">
134
<return type="PackedInt64Array" />
135
<description>
136
Returns an array of supported swapchain formats.
137
</description>
138
</method>
139
<method name="get_swapchain_format_name">
140
<return type="String" />
141
<param index="0" name="swapchain_format" type="int" />
142
<description>
143
Returns the name of the specified swapchain format.
144
</description>
145
</method>
146
<method name="get_system_id">
147
<return type="int" />
148
<description>
149
Returns the ID of the system, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html]XrSystemId[/url] cast to an integer.
150
</description>
151
</method>
152
<method name="get_view_configuration" qualifiers="const">
153
<return type="int" />
154
<description>
155
Returns the view configuration type, which is an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrViewConfigurationType.html]XrViewConfigurationType[/url] cast to an integer.
156
</description>
157
</method>
158
<method name="get_view_count" qualifiers="const">
159
<return type="int" />
160
<description>
161
Returns the number of views. It is usually two, one for each eye, but may differ with different view configurations.
162
</description>
163
</method>
164
<method name="insert_debug_label">
165
<return type="void" />
166
<param index="0" name="label_name" type="String" />
167
<description>
168
Inserts a debug label, this label is reported in any debug message resulting from the OpenXR calls that follows, until any of [method begin_debug_label_region], [method end_debug_label_region], or [method insert_debug_label] is called.
169
</description>
170
</method>
171
<method name="is_environment_blend_mode_alpha_supported">
172
<return type="int" enum="OpenXRAPIExtension.OpenXRAlphaBlendModeSupport" />
173
<description>
174
Returns [enum OpenXRAPIExtension.OpenXRAlphaBlendModeSupport] denoting if [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported, emulated or not supported at all.
175
</description>
176
</method>
177
<method name="is_initialized">
178
<return type="bool" />
179
<description>
180
Returns [code]true[/code] if OpenXR is initialized.
181
</description>
182
</method>
183
<method name="is_running">
184
<return type="bool" />
185
<description>
186
Returns [code]true[/code] if OpenXR is running ([url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html]xrBeginSession[/url] was successfully called and the swapchains were created).
187
</description>
188
</method>
189
<method name="openxr_is_enabled" qualifiers="static">
190
<return type="bool" />
191
<param index="0" name="check_run_in_editor" type="bool" />
192
<description>
193
Returns [code]true[/code] if OpenXR is enabled.
194
</description>
195
</method>
196
<method name="openxr_swapchain_acquire">
197
<return type="void" />
198
<param index="0" name="swapchain" type="int" />
199
<description>
200
Acquires the image of the provided swapchain.
201
</description>
202
</method>
203
<method name="openxr_swapchain_create">
204
<return type="int" />
205
<param index="0" name="create_flags" type="int" />
206
<param index="1" name="usage_flags" type="int" />
207
<param index="2" name="swapchain_format" type="int" />
208
<param index="3" name="width" type="int" />
209
<param index="4" name="height" type="int" />
210
<param index="5" name="sample_count" type="int" />
211
<param index="6" name="array_size" type="int" />
212
<description>
213
Returns a pointer to a new swapchain created using the provided parameters.
214
</description>
215
</method>
216
<method name="openxr_swapchain_free">
217
<return type="void" />
218
<param index="0" name="swapchain" type="int" />
219
<description>
220
Destroys the provided swapchain and frees it from memory.
221
</description>
222
</method>
223
<method name="openxr_swapchain_get_image">
224
<return type="RID" />
225
<param index="0" name="swapchain" type="int" />
226
<description>
227
Returns the RID of the provided swapchain's image.
228
</description>
229
</method>
230
<method name="openxr_swapchain_get_swapchain">
231
<return type="int" />
232
<param index="0" name="swapchain" type="int" />
233
<description>
234
Returns the [code]XrSwapchain[/code] handle of the provided swapchain.
235
</description>
236
</method>
237
<method name="openxr_swapchain_release">
238
<return type="void" />
239
<param index="0" name="swapchain" type="int" />
240
<description>
241
Releases the image of the provided swapchain.
242
</description>
243
</method>
244
<method name="register_composition_layer_provider">
245
<return type="void" />
246
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
247
<description>
248
Registers the given extension as a composition layer provider.
249
[b]Note:[/b] This cannot be called after the OpenXR session has started. However, it can be called in [method OpenXRExtensionWrapper._on_session_created].
250
</description>
251
</method>
252
<method name="register_frame_info_extension">
253
<return type="void" />
254
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
255
<description>
256
Registers the given extension as modifying frame info via the [method OpenXRExtensionWrapper._set_frame_wait_info_and_get_next_pointer], [method OpenXRExtensionWrapper._set_view_locate_info_and_get_next_pointer], or [method OpenXRExtensionWrapper._set_frame_end_info_and_get_next_pointer] virtual methods.
257
[b]Note:[/b] This cannot be called after the OpenXR session has started. However, it can be called in [method OpenXRExtensionWrapper._on_session_created].
258
</description>
259
</method>
260
<method name="register_projection_layer_extension">
261
<return type="void" />
262
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
263
<description>
264
Registers the given extension as modifying [code]XrCompositionLayerProjection[/code] via the [method OpenXRExtensionWrapper._set_projection_layer_and_get_next_pointer] virtual method.
265
[b]Note:[/b] This cannot be called after the OpenXR session has started. However, it can be called in [method OpenXRExtensionWrapper._on_session_created].
266
</description>
267
</method>
268
<method name="register_projection_views_extension">
269
<return type="void" />
270
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
271
<description>
272
Registers the given extension as a provider of additional data structures to projections views.
273
[b]Note:[/b] This cannot be called after the OpenXR session has started. However, it can be called in [method OpenXRExtensionWrapper._on_session_created].
274
</description>
275
</method>
276
<method name="set_custom_play_space">
277
<return type="void" />
278
<param index="0" name="space" type="const void*" />
279
<description>
280
Sets the reference space used by OpenXR to the given [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html]XrSpace[/url] (cast to a [code]void *[/code]).
281
</description>
282
</method>
283
<method name="set_emulate_environment_blend_mode_alpha_blend">
284
<return type="void" />
285
<param index="0" name="enabled" type="bool" />
286
<description>
287
If set to [code]true[/code], an OpenXR extension is loaded which is capable of emulating the [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] blend mode.
288
</description>
289
</method>
290
<method name="set_object_name">
291
<return type="void" />
292
<param index="0" name="object_type" type="int" />
293
<param index="1" name="object_handle" type="int" />
294
<param index="2" name="object_name" type="String" />
295
<description>
296
Set the object name of an OpenXR object, used for debug output. [param object_type] must be a valid OpenXR [code]XrObjectType[/code] enum and [param object_handle] must be a valid OpenXR object handle.
297
</description>
298
</method>
299
<method name="set_render_region">
300
<return type="void" />
301
<param index="0" name="render_region" type="Rect2i" />
302
<description>
303
Sets the render region to [param render_region], overriding the normal render target's rect.
304
</description>
305
</method>
306
<method name="set_velocity_depth_texture">
307
<return type="void" />
308
<param index="0" name="render_target" type="RID" />
309
<description>
310
Sets the render target of the velocity depth texture.
311
</description>
312
</method>
313
<method name="set_velocity_target_size">
314
<return type="void" />
315
<param index="0" name="target_size" type="Vector2i" />
316
<description>
317
Sets the target size of the velocity and velocity depth textures.
318
</description>
319
</method>
320
<method name="set_velocity_texture">
321
<return type="void" />
322
<param index="0" name="render_target" type="RID" />
323
<description>
324
Sets the render target of the velocity texture.
325
</description>
326
</method>
327
<method name="transform_from_pose">
328
<return type="Transform3D" />
329
<param index="0" name="pose" type="const void*" />
330
<description>
331
Creates a [Transform3D] from an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html]XrPosef[/url].
332
</description>
333
</method>
334
<method name="unregister_composition_layer_provider">
335
<return type="void" />
336
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
337
<description>
338
Unregisters the given extension as a composition layer provider.
339
[b]Note:[/b] This cannot be called while the OpenXR session is still running.
340
</description>
341
</method>
342
<method name="unregister_frame_info_extension">
343
<return type="void" />
344
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
345
<description>
346
Unregisters the given extension as modifying frame info.
347
[b]Note:[/b] This cannot be called while the OpenXR session is still running.
348
</description>
349
</method>
350
<method name="unregister_projection_layer_extension">
351
<return type="void" />
352
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
353
<description>
354
Unregisters the given extension as modifying [code]XrCompositionLayerProjection[/code].
355
[b]Note:[/b] This cannot be called while the OpenXR session is still running.
356
</description>
357
</method>
358
<method name="unregister_projection_views_extension">
359
<return type="void" />
360
<param index="0" name="extension" type="OpenXRExtensionWrapper" />
361
<description>
362
Unregisters the given extension as a provider of additional data structures to projections views.
363
[b]Note:[/b] This cannot be called while the OpenXR session is still running.
364
</description>
365
</method>
366
<method name="update_main_swapchain_size">
367
<return type="void" />
368
<description>
369
Request the recommended resolution from the OpenXR runtime and update the main swapchain size if it has changed.
370
</description>
371
</method>
372
<method name="xr_result">
373
<return type="bool" />
374
<param index="0" name="result" type="int" />
375
<param index="1" name="format" type="String" />
376
<param index="2" name="args" type="Array" />
377
<description>
378
Returns [code]true[/code] if the provided [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] (cast to an integer) is successful. Otherwise returns [code]false[/code] and prints the [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] converted to a string, with the specified additional information.
379
</description>
380
</method>
381
</methods>
382
<constants>
383
<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE" value="0" enum="OpenXRAlphaBlendModeSupport">
384
Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] isn't supported at all.
385
</constant>
386
<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL" value="1" enum="OpenXRAlphaBlendModeSupport">
387
Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported.
388
</constant>
389
<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING" value="2" enum="OpenXRAlphaBlendModeSupport">
390
Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is emulated.
391
</constant>
392
</constants>
393
</class>
394
395