OpenXRAPIExtension.xml 14 KB

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