Path: blob/master/modules/openxr/doc_classes/OpenXRAPIExtension.xml
22517 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="get_view_configuration" qualifiers="const">152<return type="int" />153<description>154Returns 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.155</description>156</method>157<method name="get_view_count" qualifiers="const">158<return type="int" />159<description>160Returns the number of views. It is usually two, one for each eye, but may differ with different view configurations.161</description>162</method>163<method name="insert_debug_label">164<return type="void" />165<param index="0" name="label_name" type="String" />166<description>167Inserts 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.168</description>169</method>170<method name="is_environment_blend_mode_alpha_supported">171<return type="int" enum="OpenXRAPIExtension.OpenXRAlphaBlendModeSupport" />172<description>173Returns [enum OpenXRAPIExtension.OpenXRAlphaBlendModeSupport] denoting if [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported, emulated or not supported at all.174</description>175</method>176<method name="is_initialized">177<return type="bool" />178<description>179Returns [code]true[/code] if OpenXR is initialized.180</description>181</method>182<method name="is_running">183<return type="bool" />184<description>185Returns [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).186</description>187</method>188<method name="openxr_is_enabled" qualifiers="static">189<return type="bool" />190<param index="0" name="check_run_in_editor" type="bool" />191<description>192Returns [code]true[/code] if OpenXR is enabled.193</description>194</method>195<method name="openxr_swapchain_acquire">196<return type="void" />197<param index="0" name="swapchain" type="int" />198<description>199Acquires the image of the provided swapchain.200</description>201</method>202<method name="openxr_swapchain_create">203<return type="int" />204<param index="0" name="create_flags" type="int" />205<param index="1" name="usage_flags" type="int" />206<param index="2" name="swapchain_format" type="int" />207<param index="3" name="width" type="int" />208<param index="4" name="height" type="int" />209<param index="5" name="sample_count" type="int" />210<param index="6" name="array_size" type="int" />211<description>212Returns a pointer to a new swapchain created using the provided parameters.213</description>214</method>215<method name="openxr_swapchain_free">216<return type="void" />217<param index="0" name="swapchain" type="int" />218<description>219Destroys the provided swapchain and frees it from memory.220</description>221</method>222<method name="openxr_swapchain_get_image">223<return type="RID" />224<param index="0" name="swapchain" type="int" />225<description>226Returns the RID of the provided swapchain's image.227</description>228</method>229<method name="openxr_swapchain_get_swapchain">230<return type="int" />231<param index="0" name="swapchain" type="int" />232<description>233Returns the [code]XrSwapchain[/code] handle of the provided swapchain.234</description>235</method>236<method name="openxr_swapchain_release">237<return type="void" />238<param index="0" name="swapchain" type="int" />239<description>240Releases the image of the provided swapchain.241</description>242</method>243<method name="register_composition_layer_provider">244<return type="void" />245<param index="0" name="extension" type="OpenXRExtensionWrapper" />246<description>247Registers the given extension as a composition layer provider.248[b]Note:[/b] This cannot be called after the OpenXR session has started. However, it can be called in [method OpenXRExtensionWrapper._on_session_created].249</description>250</method>251<method name="register_frame_info_extension">252<return type="void" />253<param index="0" name="extension" type="OpenXRExtensionWrapper" />254<description>255Registers 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.256[b]Note:[/b] This cannot be called after the OpenXR session has started. However, it can be called in [method OpenXRExtensionWrapper._on_session_created].257</description>258</method>259<method name="register_projection_layer_extension">260<return type="void" />261<param index="0" name="extension" type="OpenXRExtensionWrapper" />262<description>263Registers the given extension as modifying [code]XrCompositionLayerProjection[/code] via the [method OpenXRExtensionWrapper._set_projection_layer_and_get_next_pointer] virtual method.264[b]Note:[/b] This cannot be called after the OpenXR session has started. However, it can be called in [method OpenXRExtensionWrapper._on_session_created].265</description>266</method>267<method name="register_projection_views_extension">268<return type="void" />269<param index="0" name="extension" type="OpenXRExtensionWrapper" />270<description>271Registers the given extension as a provider of additional data structures to projections views.272[b]Note:[/b] This cannot be called after the OpenXR session has started. However, it can be called in [method OpenXRExtensionWrapper._on_session_created].273</description>274</method>275<method name="set_custom_play_space">276<return type="void" />277<param index="0" name="space" type="const void*" />278<description>279Sets 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]).280</description>281</method>282<method name="set_emulate_environment_blend_mode_alpha_blend">283<return type="void" />284<param index="0" name="enabled" type="bool" />285<description>286If 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.287</description>288</method>289<method name="set_object_name">290<return type="void" />291<param index="0" name="object_type" type="int" />292<param index="1" name="object_handle" type="int" />293<param index="2" name="object_name" type="String" />294<description>295Set 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.296</description>297</method>298<method name="set_render_region">299<return type="void" />300<param index="0" name="render_region" type="Rect2i" />301<description>302Sets the render region to [param render_region], overriding the normal render target's rect.303</description>304</method>305<method name="set_velocity_depth_texture">306<return type="void" />307<param index="0" name="render_target" type="RID" />308<description>309Sets the render target of the velocity depth texture.310</description>311</method>312<method name="set_velocity_target_size">313<return type="void" />314<param index="0" name="target_size" type="Vector2i" />315<description>316Sets the target size of the velocity and velocity depth textures.317</description>318</method>319<method name="set_velocity_texture">320<return type="void" />321<param index="0" name="render_target" type="RID" />322<description>323Sets the render target of the velocity texture.324</description>325</method>326<method name="transform_from_pose">327<return type="Transform3D" />328<param index="0" name="pose" type="const void*" />329<description>330Creates a [Transform3D] from an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html]XrPosef[/url].331</description>332</method>333<method name="unregister_composition_layer_provider">334<return type="void" />335<param index="0" name="extension" type="OpenXRExtensionWrapper" />336<description>337Unregisters the given extension as a composition layer provider.338[b]Note:[/b] This cannot be called while the OpenXR session is still running.339</description>340</method>341<method name="unregister_frame_info_extension">342<return type="void" />343<param index="0" name="extension" type="OpenXRExtensionWrapper" />344<description>345Unregisters the given extension as modifying frame info.346[b]Note:[/b] This cannot be called while the OpenXR session is still running.347</description>348</method>349<method name="unregister_projection_layer_extension">350<return type="void" />351<param index="0" name="extension" type="OpenXRExtensionWrapper" />352<description>353Unregisters the given extension as modifying [code]XrCompositionLayerProjection[/code].354[b]Note:[/b] This cannot be called while the OpenXR session is still running.355</description>356</method>357<method name="unregister_projection_views_extension">358<return type="void" />359<param index="0" name="extension" type="OpenXRExtensionWrapper" />360<description>361Unregisters the given extension as a provider of additional data structures to projections views.362[b]Note:[/b] This cannot be called while the OpenXR session is still running.363</description>364</method>365<method name="update_main_swapchain_size">366<return type="void" />367<description>368Request the recommended resolution from the OpenXR runtime and update the main swapchain size if it has changed.369</description>370</method>371<method name="xr_result">372<return type="bool" />373<param index="0" name="result" type="int" />374<param index="1" name="format" type="String" />375<param index="2" name="args" type="Array" />376<description>377Returns [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.378</description>379</method>380</methods>381<constants>382<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE" value="0" enum="OpenXRAlphaBlendModeSupport">383Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] isn't supported at all.384</constant>385<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL" value="1" enum="OpenXRAlphaBlendModeSupport">386Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported.387</constant>388<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING" value="2" enum="OpenXRAlphaBlendModeSupport">389Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is emulated.390</constant>391</constants>392</class>393394395