OpenXRAPIExtension.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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="begin_debug_label_region">
  21. <return type="void" />
  22. <param index="0" name="label_name" type="String" />
  23. <description>
  24. 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.
  25. </description>
  26. </method>
  27. <method name="can_render">
  28. <return type="bool" />
  29. <description>
  30. Returns [code]true[/code] if OpenXR is initialized for rendering with an XR viewport.
  31. </description>
  32. </method>
  33. <method name="end_debug_label_region">
  34. <return type="void" />
  35. <description>
  36. Marks the end of a debug label region. Removes the latest debug label region added by calling [method begin_debug_label_region].
  37. </description>
  38. </method>
  39. <method name="get_error_string">
  40. <return type="String" />
  41. <param index="0" name="result" type="int" />
  42. <description>
  43. Returns an error string for the given [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url].
  44. </description>
  45. </method>
  46. <method name="get_hand_tracker">
  47. <return type="int" />
  48. <param index="0" name="hand_index" type="int" />
  49. <description>
  50. Returns the corresponding [code]XRHandTrackerEXT[/code] handle for the given hand index value.
  51. </description>
  52. </method>
  53. <method name="get_instance">
  54. <return type="int" />
  55. <description>
  56. 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.
  57. </description>
  58. </method>
  59. <method name="get_instance_proc_addr">
  60. <return type="int" />
  61. <param index="0" name="name" type="String" />
  62. <description>
  63. 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].
  64. [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].
  65. </description>
  66. </method>
  67. <method name="get_next_frame_time">
  68. <return type="int" />
  69. <description>
  70. Returns the predicted display timing for the next frame.
  71. </description>
  72. </method>
  73. <method name="get_play_space">
  74. <return type="int" />
  75. <description>
  76. 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.
  77. </description>
  78. </method>
  79. <method name="get_predicted_display_time">
  80. <return type="int" />
  81. <description>
  82. Returns the predicted display timing for the current frame.
  83. </description>
  84. </method>
  85. <method name="get_session">
  86. <return type="int" />
  87. <description>
  88. 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.
  89. </description>
  90. </method>
  91. <method name="get_swapchain_format_name">
  92. <return type="String" />
  93. <param index="0" name="swapchain_format" type="int" />
  94. <description>
  95. Returns the name of the specified swapchain format.
  96. </description>
  97. </method>
  98. <method name="get_system_id">
  99. <return type="int" />
  100. <description>
  101. 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.
  102. </description>
  103. </method>
  104. <method name="insert_debug_label">
  105. <return type="void" />
  106. <param index="0" name="label_name" type="String" />
  107. <description>
  108. 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.
  109. </description>
  110. </method>
  111. <method name="is_environment_blend_mode_alpha_supported">
  112. <return type="int" enum="OpenXRAPIExtension.OpenXRAlphaBlendModeSupport" />
  113. <description>
  114. Returns [enum OpenXRAPIExtension.OpenXRAlphaBlendModeSupport] denoting if [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported, emulated or not supported at all.
  115. </description>
  116. </method>
  117. <method name="is_initialized">
  118. <return type="bool" />
  119. <description>
  120. Returns [code]true[/code] if OpenXR is initialized.
  121. </description>
  122. </method>
  123. <method name="is_running">
  124. <return type="bool" />
  125. <description>
  126. 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).
  127. </description>
  128. </method>
  129. <method name="openxr_is_enabled" qualifiers="static">
  130. <return type="bool" />
  131. <param index="0" name="check_run_in_editor" type="bool" />
  132. <description>
  133. Returns [code]true[/code] if OpenXR is enabled.
  134. </description>
  135. </method>
  136. <method name="register_composition_layer_provider">
  137. <return type="void" />
  138. <param index="0" name="extension" type="OpenXRExtensionWrapperExtension" />
  139. <description>
  140. Registers the given extension as a composition layer provider.
  141. </description>
  142. </method>
  143. <method name="set_emulate_environment_blend_mode_alpha_blend">
  144. <return type="void" />
  145. <param index="0" name="enabled" type="bool" />
  146. <description>
  147. 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.
  148. </description>
  149. </method>
  150. <method name="set_object_name">
  151. <return type="void" />
  152. <param index="0" name="object_type" type="int" />
  153. <param index="1" name="object_handle" type="int" />
  154. <param index="2" name="object_name" type="String" />
  155. <description>
  156. 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.
  157. </description>
  158. </method>
  159. <method name="transform_from_pose">
  160. <return type="Transform3D" />
  161. <param index="0" name="pose" type="const void*" />
  162. <description>
  163. Creates a [Transform3D] from an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html]XrPosef[/url].
  164. </description>
  165. </method>
  166. <method name="unregister_composition_layer_provider">
  167. <return type="void" />
  168. <param index="0" name="extension" type="OpenXRExtensionWrapperExtension" />
  169. <description>
  170. Unregisters the given extension as a composition layer provider.
  171. </description>
  172. </method>
  173. <method name="xr_result">
  174. <return type="bool" />
  175. <param index="0" name="result" type="int" />
  176. <param index="1" name="format" type="String" />
  177. <param index="2" name="args" type="Array" />
  178. <description>
  179. 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.
  180. </description>
  181. </method>
  182. </methods>
  183. <constants>
  184. <constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE" value="0" enum="OpenXRAlphaBlendModeSupport">
  185. Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] isn't supported at all.
  186. </constant>
  187. <constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL" value="1" enum="OpenXRAlphaBlendModeSupport">
  188. Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is really supported.
  189. </constant>
  190. <constant name="OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING" value="2" enum="OpenXRAlphaBlendModeSupport">
  191. Means that [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] is emulated.
  192. </constant>
  193. </constants>
  194. </class>