OpenXRAPIExtension.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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="can_render">
  21. <return type="bool" />
  22. <description>
  23. Returns [code]true[/code] if OpenXR is initialized for rendering with an XR viewport.
  24. </description>
  25. </method>
  26. <method name="get_error_string">
  27. <return type="String" />
  28. <param index="0" name="result" type="int" />
  29. <description>
  30. Returns an error string for the given [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url].
  31. </description>
  32. </method>
  33. <method name="get_instance">
  34. <return type="int" />
  35. <description>
  36. 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.
  37. </description>
  38. </method>
  39. <method name="get_instance_proc_addr">
  40. <return type="int" />
  41. <param index="0" name="name" type="String" />
  42. <description>
  43. 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].
  44. [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].
  45. </description>
  46. </method>
  47. <method name="get_next_frame_time">
  48. <return type="int" />
  49. <description>
  50. Returns the timing for the next frame.
  51. </description>
  52. </method>
  53. <method name="get_play_space">
  54. <return type="int" />
  55. <description>
  56. 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.
  57. </description>
  58. </method>
  59. <method name="get_session">
  60. <return type="int" />
  61. <description>
  62. 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.
  63. </description>
  64. </method>
  65. <method name="get_swapchain_format_name">
  66. <return type="String" />
  67. <param index="0" name="swapchain_format" type="int" />
  68. <description>
  69. Returns the name of the specified swapchain format.
  70. </description>
  71. </method>
  72. <method name="get_system_id">
  73. <return type="int" />
  74. <description>
  75. 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.
  76. </description>
  77. </method>
  78. <method name="is_initialized">
  79. <return type="bool" />
  80. <description>
  81. Returns [code]true[/code] if OpenXR is initialized.
  82. </description>
  83. </method>
  84. <method name="is_running">
  85. <return type="bool" />
  86. <description>
  87. 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).
  88. </description>
  89. </method>
  90. <method name="openxr_is_enabled" qualifiers="static">
  91. <return type="bool" />
  92. <param index="0" name="check_run_in_editor" type="bool" />
  93. <description>
  94. Returns [code]true[/code] if OpenXR is enabled.
  95. </description>
  96. </method>
  97. <method name="transform_from_pose">
  98. <return type="Transform3D" />
  99. <param index="0" name="pose" type="const void*" />
  100. <description>
  101. Creates a [Transform3D] from an [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html]XrPosef[/url].
  102. </description>
  103. </method>
  104. <method name="xr_result">
  105. <return type="bool" />
  106. <param index="0" name="result" type="int" />
  107. <param index="1" name="format" type="String" />
  108. <param index="2" name="args" type="Array" />
  109. <description>
  110. 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.
  111. </description>
  112. </method>
  113. </methods>
  114. </class>