class_openxrapiextension.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/modules/openxr/doc_classes/OpenXRAPIExtension.xml.
  6. .. _class_OpenXRAPIExtension:
  7. OpenXRAPIExtension
  8. ==================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Makes the OpenXR API available for GDExtension.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **OpenXRAPIExtension** makes OpenXR available for GDExtension. It provides the OpenXR API to GDExtension through the :ref:`get_instance_proc_addr<class_OpenXRAPIExtension_method_get_instance_proc_addr>` method, and the OpenXR instance through :ref:`get_instance<class_OpenXRAPIExtension_method_get_instance>`.
  15. It also provides methods for querying the status of OpenXR initialization, and helper methods for ease of use of the API with GDExtension.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - `XrResult documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html>`__
  20. - `XrInstance documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html>`__
  21. - `XrSpace documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html>`__
  22. - `XrSession documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html>`__
  23. - `XrSystemId documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html>`__
  24. - `xrBeginSession documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html>`__
  25. - `XrPosef documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html>`__
  26. .. rst-class:: classref-reftable-group
  27. Methods
  28. -------
  29. .. table::
  30. :widths: auto
  31. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`can_render<class_OpenXRAPIExtension_method_can_render>` **(** **)** |
  33. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`String<class_String>` | :ref:`get_error_string<class_OpenXRAPIExtension_method_get_error_string>` **(** :ref:`int<class_int>` result **)** |
  35. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`get_instance<class_OpenXRAPIExtension_method_get_instance>` **(** **)** |
  37. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`int<class_int>` | :ref:`get_instance_proc_addr<class_OpenXRAPIExtension_method_get_instance_proc_addr>` **(** :ref:`String<class_String>` name **)** |
  39. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`get_next_frame_time<class_OpenXRAPIExtension_method_get_next_frame_time>` **(** **)** |
  41. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`get_play_space<class_OpenXRAPIExtension_method_get_play_space>` **(** **)** |
  43. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`int<class_int>` | :ref:`get_session<class_OpenXRAPIExtension_method_get_session>` **(** **)** |
  45. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`String<class_String>` | :ref:`get_swapchain_format_name<class_OpenXRAPIExtension_method_get_swapchain_format_name>` **(** :ref:`int<class_int>` swapchain_format **)** |
  47. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`int<class_int>` | :ref:`get_system_id<class_OpenXRAPIExtension_method_get_system_id>` **(** **)** |
  49. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`is_initialized<class_OpenXRAPIExtension_method_is_initialized>` **(** **)** |
  51. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`is_running<class_OpenXRAPIExtension_method_is_running>` **(** **)** |
  53. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`openxr_is_enabled<class_OpenXRAPIExtension_method_openxr_is_enabled>` **(** :ref:`bool<class_bool>` check_run_in_editor **)** |static| |
  55. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Transform3D<class_Transform3D>` | :ref:`transform_from_pose<class_OpenXRAPIExtension_method_transform_from_pose>` **(** const void* pose **)** |
  57. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`xr_result<class_OpenXRAPIExtension_method_xr_result>` **(** :ref:`int<class_int>` result, :ref:`String<class_String>` format, :ref:`Array<class_Array>` args **)** |
  59. +---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. .. rst-class:: classref-section-separator
  61. ----
  62. .. rst-class:: classref-descriptions-group
  63. Method Descriptions
  64. -------------------
  65. .. _class_OpenXRAPIExtension_method_can_render:
  66. .. rst-class:: classref-method
  67. :ref:`bool<class_bool>` **can_render** **(** **)**
  68. Returns ``true`` if OpenXR is initialized for rendering with an XR viewport.
  69. .. rst-class:: classref-item-separator
  70. ----
  71. .. _class_OpenXRAPIExtension_method_get_error_string:
  72. .. rst-class:: classref-method
  73. :ref:`String<class_String>` **get_error_string** **(** :ref:`int<class_int>` result **)**
  74. Returns an error string for the given `XrResult <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html>`__.
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_OpenXRAPIExtension_method_get_instance:
  78. .. rst-class:: classref-method
  79. :ref:`int<class_int>` **get_instance** **(** **)**
  80. Returns the `XrInstance <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html>`__ created during the initialization of the OpenXR API.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_OpenXRAPIExtension_method_get_instance_proc_addr:
  84. .. rst-class:: classref-method
  85. :ref:`int<class_int>` **get_instance_proc_addr** **(** :ref:`String<class_String>` name **)**
  86. 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 ``0``.
  87. \ **Note:** ``openxr/util.h`` contains utility macros for acquiring OpenXR functions, e.g. ``GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)``.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_OpenXRAPIExtension_method_get_next_frame_time:
  91. .. rst-class:: classref-method
  92. :ref:`int<class_int>` **get_next_frame_time** **(** **)**
  93. Returns the timing for the next frame.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_OpenXRAPIExtension_method_get_play_space:
  97. .. rst-class:: classref-method
  98. :ref:`int<class_int>` **get_play_space** **(** **)**
  99. Returns the play space, which is an `XrSpace <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html>`__ cast to an integer.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_OpenXRAPIExtension_method_get_session:
  103. .. rst-class:: classref-method
  104. :ref:`int<class_int>` **get_session** **(** **)**
  105. Returns the OpenXR session, which is an `XrSession <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html>`__ cast to an integer.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_OpenXRAPIExtension_method_get_swapchain_format_name:
  109. .. rst-class:: classref-method
  110. :ref:`String<class_String>` **get_swapchain_format_name** **(** :ref:`int<class_int>` swapchain_format **)**
  111. Returns the name of the specified swapchain format.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_OpenXRAPIExtension_method_get_system_id:
  115. .. rst-class:: classref-method
  116. :ref:`int<class_int>` **get_system_id** **(** **)**
  117. Returns the id of the system, which is a `XrSystemId <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html>`__ cast to an integer.
  118. .. rst-class:: classref-item-separator
  119. ----
  120. .. _class_OpenXRAPIExtension_method_is_initialized:
  121. .. rst-class:: classref-method
  122. :ref:`bool<class_bool>` **is_initialized** **(** **)**
  123. Returns ``true`` if OpenXR is initialized.
  124. .. rst-class:: classref-item-separator
  125. ----
  126. .. _class_OpenXRAPIExtension_method_is_running:
  127. .. rst-class:: classref-method
  128. :ref:`bool<class_bool>` **is_running** **(** **)**
  129. Returns ``true`` if OpenXR is running (`xrBeginSession <https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html>`__ was successfully called and the swapchains were created).
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_OpenXRAPIExtension_method_openxr_is_enabled:
  133. .. rst-class:: classref-method
  134. :ref:`bool<class_bool>` **openxr_is_enabled** **(** :ref:`bool<class_bool>` check_run_in_editor **)** |static|
  135. Returns ``true`` if OpenXR is enabled.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_OpenXRAPIExtension_method_transform_from_pose:
  139. .. rst-class:: classref-method
  140. :ref:`Transform3D<class_Transform3D>` **transform_from_pose** **(** const void* pose **)**
  141. Creates a :ref:`Transform3D<class_Transform3D>` from an `XrPosef <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html>`__.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_OpenXRAPIExtension_method_xr_result:
  145. .. rst-class:: classref-method
  146. :ref:`bool<class_bool>` **xr_result** **(** :ref:`int<class_int>` result, :ref:`String<class_String>` format, :ref:`Array<class_Array>` args **)**
  147. Returns ``true`` if the provided `XrResult <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html>`__ (cast to an integer) is successful. Otherwise returns ``false`` and prints the `XrResult <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html>`__ converted to a string, with the specified additional information.
  148. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  149. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  150. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  151. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  152. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  153. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  154. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`