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