Path: blob/master/modules/openxr/doc_classes/OpenXRAPIExtension.xml
10278 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_play_space">88<return type="int" />89<description>90Returns 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.91</description>92</method>93<method name="get_predicted_display_time">94<return type="int" />95<description>96Returns the predicted display timing for the current frame.97</description>98</method>99<method name="get_projection_layer">100<return type="int" />101<description>102Returns a pointer to the render state's [code]XrCompositionLayerProjection[/code] struct.103[b]Note:[/b] This method should only be called from the rendering thread.104</description>105</method>106<method name="get_render_state_z_far">107<return type="float" />108<description>109Returns the far boundary value of the camera frustum.110[b]Note:[/b] This is only accessible in the render thread.111</description>112</method>113<method name="get_render_state_z_near">114<return type="float" />115<description>116Returns the near 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_session">121<return type="int" />122<description>123Returns 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.124</description>125</method>126<method name="get_supported_swapchain_formats">127<return type="PackedInt64Array" />128<description>129Returns an array of supported swapchain formats.130</description>131</method>132<method name="get_swapchain_format_name">133<return type="String" />134<param index="0" name="swapchain_format" type="int" />135<description>136Returns the name of the specified swapchain format.137</description>138</method>139<method name="get_system_id">140<return type="int" />141<description>142Returns 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.143</description>144</method>145<method name="insert_debug_label">146<return type="void" />147<param index="0" name="label_name" type="String" />148<description>149Inserts 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.150</description>151</method>152<method name="is_environment_blend_mode_alpha_supported">153<return type="int" enum="OpenXRAPIExtension.OpenXRAlphaBlendModeSupport" />154<description>155Returns [enum OpenXRAPIExtension.OpenXRAlphaBlendModeSupport] denoting if [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported, emulated or not supported at all.156</description>157</method>158<method name="is_initialized">159<return type="bool" />160<description>161Returns [code]true[/code] if OpenXR is initialized.162</description>163</method>164<method name="is_running">165<return type="bool" />166<description>167Returns [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).168</description>169</method>170<method name="openxr_is_enabled" qualifiers="static">171<return type="bool" />172<param index="0" name="check_run_in_editor" type="bool" />173<description>174Returns [code]true[/code] if OpenXR is enabled.175</description>176</method>177<method name="openxr_swapchain_acquire">178<return type="void" />179<param index="0" name="swapchain" type="int" />180<description>181Acquires the image of the provided swapchain.182</description>183</method>184<method name="openxr_swapchain_create">185<return type="int" />186<param index="0" name="create_flags" type="int" />187<param index="1" name="usage_flags" type="int" />188<param index="2" name="swapchain_format" type="int" />189<param index="3" name="width" type="int" />190<param index="4" name="height" type="int" />191<param index="5" name="sample_count" type="int" />192<param index="6" name="array_size" type="int" />193<description>194Returns a pointer to a new swapchain created using the provided parameters.195</description>196</method>197<method name="openxr_swapchain_free">198<return type="void" />199<param index="0" name="swapchain" type="int" />200<description>201Destroys the provided swapchain and frees it from memory.202</description>203</method>204<method name="openxr_swapchain_get_image">205<return type="RID" />206<param index="0" name="swapchain" type="int" />207<description>208Returns the RID of the provided swapchain's image.209</description>210</method>211<method name="openxr_swapchain_get_swapchain">212<return type="int" />213<param index="0" name="swapchain" type="int" />214<description>215Returns the [code]XrSwapchain[/code] handle of the provided swapchain.216</description>217</method>218<method name="openxr_swapchain_release">219<return type="void" />220<param index="0" name="swapchain" type="int" />221<description>222Releases the image of the provided swapchain.223</description>224</method>225<method name="register_composition_layer_provider">226<return type="void" />227<param index="0" name="extension" type="OpenXRExtensionWrapper" />228<description>229Registers the given extension as a composition layer provider.230</description>231</method>232<method name="register_frame_info_extension">233<return type="void" />234<param index="0" name="extension" type="OpenXRExtensionWrapper" />235<description>236Registers 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.237</description>238</method>239<method name="register_projection_views_extension">240<return type="void" />241<param index="0" name="extension" type="OpenXRExtensionWrapper" />242<description>243Registers the given extension as a provider of additional data structures to projections views.244</description>245</method>246<method name="set_custom_play_space">247<return type="void" />248<param index="0" name="space" type="const void*" />249<description>250Sets 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]).251</description>252</method>253<method name="set_emulate_environment_blend_mode_alpha_blend">254<return type="void" />255<param index="0" name="enabled" type="bool" />256<description>257If 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.258</description>259</method>260<method name="set_object_name">261<return type="void" />262<param index="0" name="object_type" type="int" />263<param index="1" name="object_handle" type="int" />264<param index="2" name="object_name" type="String" />265<description>266Set 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.267</description>268</method>269<method name="set_render_region">270<return type="void" />271<param index="0" name="render_region" type="Rect2i" />272<description>273Sets the render region to [param render_region], overriding the normal render target's rect.274</description>275</method>276<method name="set_velocity_depth_texture">277<return type="void" />278<param index="0" name="render_target" type="RID" />279<description>280Sets the render target of the velocity depth texture.281</description>282</method>283<method name="set_velocity_target_size">284<return type="void" />285<param index="0" name="target_size" type="Vector2i" />286<description>287Sets the target size of the velocity and velocity depth textures.288</description>289</method>290<method name="set_velocity_texture">291<return type="void" />292<param index="0" name="render_target" type="RID" />293<description>294Sets the render target of the velocity texture.295</description>296</method>297<method name="transform_from_pose">298<return type="Transform3D" />299<param index="0" name="pose" type="const void*" />300<description>301Creates a [Transform3D] from an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html]XrPosef[/url].302</description>303</method>304<method name="unregister_composition_layer_provider">305<return type="void" />306<param index="0" name="extension" type="OpenXRExtensionWrapper" />307<description>308Unregisters the given extension as a composition layer provider.309</description>310</method>311<method name="unregister_frame_info_extension">312<return type="void" />313<param index="0" name="extension" type="OpenXRExtensionWrapper" />314<description>315Unregisters the given extension as modifying frame info.316</description>317</method>318<method name="unregister_projection_views_extension">319<return type="void" />320<param index="0" name="extension" type="OpenXRExtensionWrapper" />321<description>322Unregisters the given extension as a provider of additional data structures to projections views.323</description>324</method>325<method name="xr_result">326<return type="bool" />327<param index="0" name="result" type="int" />328<param index="1" name="format" type="String" />329<param index="2" name="args" type="Array" />330<description>331Returns [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.332</description>333</method>334</methods>335<constants>336<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE" value="0" enum="OpenXRAlphaBlendModeSupport">337Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] isn't supported at all.338</constant>339<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL" value="1" enum="OpenXRAlphaBlendModeSupport">340Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported.341</constant>342<constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING" value="2" enum="OpenXRAlphaBlendModeSupport">343Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is emulated.344</constant>345</constants>346</class>347348349