Files
godot-docs/classes/class_openxrapiextension.rst
2025-02-15 03:21:09 +00:00

703 lines
59 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/modules/openxr/doc_classes/OpenXRAPIExtension.xml.
.. _class_OpenXRAPIExtension:
OpenXRAPIExtension
==================
**Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
Makes the OpenXR API available for GDExtension.
.. rst-class:: classref-introduction-group
Description
-----------
**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>`.
It also provides methods for querying the status of OpenXR initialization, and helper methods for ease of use of the API with GDExtension.
.. rst-class:: classref-introduction-group
Tutorials
---------
- `XrResult documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html>`__
- `XrInstance documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html>`__
- `XrSpace documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html>`__
- `XrSession documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html>`__
- `XrSystemId documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html>`__
- `xrBeginSession documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html>`__
- `XrPosef documentation <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html>`__
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`action_get_handle<class_OpenXRAPIExtension_method_action_get_handle>`\ (\ action\: :ref:`RID<class_RID>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`begin_debug_label_region<class_OpenXRAPIExtension_method_begin_debug_label_region>`\ (\ label_name\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`can_render<class_OpenXRAPIExtension_method_can_render>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`end_debug_label_region<class_OpenXRAPIExtension_method_end_debug_label_region>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`RID<class_RID>` | :ref:`find_action<class_OpenXRAPIExtension_method_find_action>`\ (\ name\: :ref:`String<class_String>`, action_set\: :ref:`RID<class_RID>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_error_string<class_OpenXRAPIExtension_method_get_error_string>`\ (\ result\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_hand_tracker<class_OpenXRAPIExtension_method_get_hand_tracker>`\ (\ hand_index\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_instance<class_OpenXRAPIExtension_method_get_instance>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_instance_proc_addr<class_OpenXRAPIExtension_method_get_instance_proc_addr>`\ (\ name\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_next_frame_time<class_OpenXRAPIExtension_method_get_next_frame_time>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_play_space<class_OpenXRAPIExtension_method_get_play_space>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_predicted_display_time<class_OpenXRAPIExtension_method_get_predicted_display_time>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_projection_layer<class_OpenXRAPIExtension_method_get_projection_layer>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_render_state_z_far<class_OpenXRAPIExtension_method_get_render_state_z_far>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_render_state_z_near<class_OpenXRAPIExtension_method_get_render_state_z_near>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_session<class_OpenXRAPIExtension_method_get_session>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedInt64Array<class_PackedInt64Array>` | :ref:`get_supported_swapchain_formats<class_OpenXRAPIExtension_method_get_supported_swapchain_formats>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_swapchain_format_name<class_OpenXRAPIExtension_method_get_swapchain_format_name>`\ (\ swapchain_format\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_system_id<class_OpenXRAPIExtension_method_get_system_id>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`insert_debug_label<class_OpenXRAPIExtension_method_insert_debug_label>`\ (\ label_name\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`OpenXRAlphaBlendModeSupport<enum_OpenXRAPIExtension_OpenXRAlphaBlendModeSupport>` | :ref:`is_environment_blend_mode_alpha_supported<class_OpenXRAPIExtension_method_is_environment_blend_mode_alpha_supported>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_initialized<class_OpenXRAPIExtension_method_is_initialized>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_running<class_OpenXRAPIExtension_method_is_running>`\ (\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`openxr_is_enabled<class_OpenXRAPIExtension_method_openxr_is_enabled>`\ (\ check_run_in_editor\: :ref:`bool<class_bool>`\ ) |static| |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`openxr_swapchain_acquire<class_OpenXRAPIExtension_method_openxr_swapchain_acquire>`\ (\ swapchain\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`openxr_swapchain_create<class_OpenXRAPIExtension_method_openxr_swapchain_create>`\ (\ create_flags\: :ref:`int<class_int>`, usage_flags\: :ref:`int<class_int>`, swapchain_format\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, sample_count\: :ref:`int<class_int>`, array_size\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`openxr_swapchain_free<class_OpenXRAPIExtension_method_openxr_swapchain_free>`\ (\ swapchain\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`RID<class_RID>` | :ref:`openxr_swapchain_get_image<class_OpenXRAPIExtension_method_openxr_swapchain_get_image>`\ (\ swapchain\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`openxr_swapchain_get_swapchain<class_OpenXRAPIExtension_method_openxr_swapchain_get_swapchain>`\ (\ swapchain\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`openxr_swapchain_release<class_OpenXRAPIExtension_method_openxr_swapchain_release>`\ (\ swapchain\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`register_composition_layer_provider<class_OpenXRAPIExtension_method_register_composition_layer_provider>`\ (\ extension\: :ref:`OpenXRExtensionWrapperExtension<class_OpenXRExtensionWrapperExtension>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`register_projection_views_extension<class_OpenXRAPIExtension_method_register_projection_views_extension>`\ (\ extension\: :ref:`OpenXRExtensionWrapperExtension<class_OpenXRExtensionWrapperExtension>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_emulate_environment_blend_mode_alpha_blend<class_OpenXRAPIExtension_method_set_emulate_environment_blend_mode_alpha_blend>`\ (\ enabled\: :ref:`bool<class_bool>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_object_name<class_OpenXRAPIExtension_method_set_object_name>`\ (\ object_type\: :ref:`int<class_int>`, object_handle\: :ref:`int<class_int>`, object_name\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_render_region<class_OpenXRAPIExtension_method_set_render_region>`\ (\ render_region\: :ref:`Rect2i<class_Rect2i>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_velocity_depth_texture<class_OpenXRAPIExtension_method_set_velocity_depth_texture>`\ (\ render_target\: :ref:`RID<class_RID>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_velocity_target_size<class_OpenXRAPIExtension_method_set_velocity_target_size>`\ (\ target_size\: :ref:`Vector2i<class_Vector2i>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_velocity_texture<class_OpenXRAPIExtension_method_set_velocity_texture>`\ (\ render_target\: :ref:`RID<class_RID>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform3D<class_Transform3D>` | :ref:`transform_from_pose<class_OpenXRAPIExtension_method_transform_from_pose>`\ (\ pose\: ``const void*``\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`unregister_composition_layer_provider<class_OpenXRAPIExtension_method_unregister_composition_layer_provider>`\ (\ extension\: :ref:`OpenXRExtensionWrapperExtension<class_OpenXRExtensionWrapperExtension>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`unregister_projection_views_extension<class_OpenXRAPIExtension_method_unregister_projection_views_extension>`\ (\ extension\: :ref:`OpenXRExtensionWrapperExtension<class_OpenXRExtensionWrapperExtension>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`xr_result<class_OpenXRAPIExtension_method_xr_result>`\ (\ result\: :ref:`int<class_int>`, format\: :ref:`String<class_String>`, args\: :ref:`Array<class_Array>`\ ) |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_OpenXRAPIExtension_OpenXRAlphaBlendModeSupport:
.. rst-class:: classref-enumeration
enum **OpenXRAlphaBlendModeSupport**: :ref:`🔗<enum_OpenXRAPIExtension_OpenXRAlphaBlendModeSupport>`
.. _class_OpenXRAPIExtension_constant_OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE:
.. rst-class:: classref-enumeration-constant
:ref:`OpenXRAlphaBlendModeSupport<enum_OpenXRAPIExtension_OpenXRAlphaBlendModeSupport>` **OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE** = ``0``
Means that :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND<class_XRInterface_constant_XR_ENV_BLEND_MODE_ALPHA_BLEND>` isn't supported at all.
.. _class_OpenXRAPIExtension_constant_OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL:
.. rst-class:: classref-enumeration-constant
:ref:`OpenXRAlphaBlendModeSupport<enum_OpenXRAPIExtension_OpenXRAlphaBlendModeSupport>` **OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL** = ``1``
Means that :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND<class_XRInterface_constant_XR_ENV_BLEND_MODE_ALPHA_BLEND>` is really supported.
.. _class_OpenXRAPIExtension_constant_OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING:
.. rst-class:: classref-enumeration-constant
:ref:`OpenXRAlphaBlendModeSupport<enum_OpenXRAPIExtension_OpenXRAlphaBlendModeSupport>` **OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING** = ``2``
Means that :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND<class_XRInterface_constant_XR_ENV_BLEND_MODE_ALPHA_BLEND>` is emulated.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_OpenXRAPIExtension_method_action_get_handle:
.. rst-class:: classref-method
:ref:`int<class_int>` **action_get_handle**\ (\ action\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_action_get_handle>`
Returns the corresponding ``XrAction`` OpenXR handle for the given action RID.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_begin_debug_label_region:
.. rst-class:: classref-method
|void| **begin_debug_label_region**\ (\ label_name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_begin_debug_label_region>`
Begins a new debug label region, this label will be reported in debug messages for any calls following this until :ref:`end_debug_label_region()<class_OpenXRAPIExtension_method_end_debug_label_region>` is called. Debug labels can be stacked.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_can_render:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **can_render**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_can_render>`
Returns ``true`` if OpenXR is initialized for rendering with an XR viewport.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_end_debug_label_region:
.. rst-class:: classref-method
|void| **end_debug_label_region**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_end_debug_label_region>`
Marks the end of a debug label region. Removes the latest debug label region added by calling :ref:`begin_debug_label_region()<class_OpenXRAPIExtension_method_begin_debug_label_region>`.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_find_action:
.. rst-class:: classref-method
:ref:`RID<class_RID>` **find_action**\ (\ name\: :ref:`String<class_String>`, action_set\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_find_action>`
Returns the :ref:`RID<class_RID>` corresponding to an ``Action`` of a matching name, optionally limited to a specified action set.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_error_string:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_error_string**\ (\ result\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_error_string>`
Returns an error string for the given `XrResult <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html>`__.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_hand_tracker:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_hand_tracker**\ (\ hand_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_hand_tracker>`
Returns the corresponding ``XRHandTrackerEXT`` handle for the given hand index value.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_instance:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_instance**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_instance>`
Returns the `XrInstance <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html>`__ created during the initialization of the OpenXR API.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_instance_proc_addr:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_instance_proc_addr**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_instance_proc_addr>`
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``.
\ **Note:** ``openxr/util.h`` contains utility macros for acquiring OpenXR functions, e.g. ``GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)``.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_next_frame_time:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_next_frame_time**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_next_frame_time>`
Returns the predicted display timing for the next frame.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_play_space:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_play_space**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_play_space>`
Returns the play space, which is an `XrSpace <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html>`__ cast to an integer.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_predicted_display_time:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_predicted_display_time**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_predicted_display_time>`
Returns the predicted display timing for the current frame.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_projection_layer:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_projection_layer**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_projection_layer>`
Returns a pointer to the render state's ``XrCompositionLayerProjection`` struct.
\ **Note:** This method should only be called from the rendering thread.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_render_state_z_far:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_render_state_z_far**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_render_state_z_far>`
Returns the far boundary value of the camera frustum.
\ **Note:** This is only accessible in the render thread.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_render_state_z_near:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_render_state_z_near**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_render_state_z_near>`
Returns the near boundary value of the camera frustum.
\ **Note:** This is only accessible in the render thread.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_session:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_session**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_session>`
Returns the OpenXR session, which is an `XrSession <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html>`__ cast to an integer.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_supported_swapchain_formats:
.. rst-class:: classref-method
:ref:`PackedInt64Array<class_PackedInt64Array>` **get_supported_swapchain_formats**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_supported_swapchain_formats>`
Returns an array of supported swapchain formats.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_swapchain_format_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_swapchain_format_name**\ (\ swapchain_format\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_swapchain_format_name>`
Returns the name of the specified swapchain format.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_get_system_id:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_system_id**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_get_system_id>`
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.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_insert_debug_label:
.. rst-class:: classref-method
|void| **insert_debug_label**\ (\ label_name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_insert_debug_label>`
Inserts a debug label, this label is reported in any debug message resulting from the OpenXR calls that follows, until any of :ref:`begin_debug_label_region()<class_OpenXRAPIExtension_method_begin_debug_label_region>`, :ref:`end_debug_label_region()<class_OpenXRAPIExtension_method_end_debug_label_region>`, or :ref:`insert_debug_label()<class_OpenXRAPIExtension_method_insert_debug_label>` is called.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_is_environment_blend_mode_alpha_supported:
.. rst-class:: classref-method
:ref:`OpenXRAlphaBlendModeSupport<enum_OpenXRAPIExtension_OpenXRAlphaBlendModeSupport>` **is_environment_blend_mode_alpha_supported**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_is_environment_blend_mode_alpha_supported>`
Returns :ref:`OpenXRAlphaBlendModeSupport<enum_OpenXRAPIExtension_OpenXRAlphaBlendModeSupport>` denoting if :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND<class_XRInterface_constant_XR_ENV_BLEND_MODE_ALPHA_BLEND>` is really supported, emulated or not supported at all.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_is_initialized:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_initialized**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_is_initialized>`
Returns ``true`` if OpenXR is initialized.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_is_running:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_running**\ (\ ) :ref:`🔗<class_OpenXRAPIExtension_method_is_running>`
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).
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_openxr_is_enabled:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **openxr_is_enabled**\ (\ check_run_in_editor\: :ref:`bool<class_bool>`\ ) |static| :ref:`🔗<class_OpenXRAPIExtension_method_openxr_is_enabled>`
Returns ``true`` if OpenXR is enabled.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_openxr_swapchain_acquire:
.. rst-class:: classref-method
|void| **openxr_swapchain_acquire**\ (\ swapchain\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_openxr_swapchain_acquire>`
Acquires the image of the provided swapchain.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_openxr_swapchain_create:
.. rst-class:: classref-method
:ref:`int<class_int>` **openxr_swapchain_create**\ (\ create_flags\: :ref:`int<class_int>`, usage_flags\: :ref:`int<class_int>`, swapchain_format\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`, height\: :ref:`int<class_int>`, sample_count\: :ref:`int<class_int>`, array_size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_openxr_swapchain_create>`
Returns a pointer to a new swapchain created using the provided parameters.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_openxr_swapchain_free:
.. rst-class:: classref-method
|void| **openxr_swapchain_free**\ (\ swapchain\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_openxr_swapchain_free>`
Destroys the provided swapchain and frees it from memory.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_openxr_swapchain_get_image:
.. rst-class:: classref-method
:ref:`RID<class_RID>` **openxr_swapchain_get_image**\ (\ swapchain\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_openxr_swapchain_get_image>`
Returns the RID of the provided swapchain's image.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_openxr_swapchain_get_swapchain:
.. rst-class:: classref-method
:ref:`int<class_int>` **openxr_swapchain_get_swapchain**\ (\ swapchain\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_openxr_swapchain_get_swapchain>`
Returns the ``XrSwapchain`` handle of the provided swapchain.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_openxr_swapchain_release:
.. rst-class:: classref-method
|void| **openxr_swapchain_release**\ (\ swapchain\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_openxr_swapchain_release>`
Releases the image of the provided swapchain.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_register_composition_layer_provider:
.. rst-class:: classref-method
|void| **register_composition_layer_provider**\ (\ extension\: :ref:`OpenXRExtensionWrapperExtension<class_OpenXRExtensionWrapperExtension>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_register_composition_layer_provider>`
Registers the given extension as a composition layer provider.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_register_projection_views_extension:
.. rst-class:: classref-method
|void| **register_projection_views_extension**\ (\ extension\: :ref:`OpenXRExtensionWrapperExtension<class_OpenXRExtensionWrapperExtension>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_register_projection_views_extension>`
Registers the given extension as a provider of additional data structures to projections views.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_set_emulate_environment_blend_mode_alpha_blend:
.. rst-class:: classref-method
|void| **set_emulate_environment_blend_mode_alpha_blend**\ (\ enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_set_emulate_environment_blend_mode_alpha_blend>`
If set to ``true``, an OpenXR extension is loaded which is capable of emulating the :ref:`XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND<class_XRInterface_constant_XR_ENV_BLEND_MODE_ALPHA_BLEND>` blend mode.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_set_object_name:
.. rst-class:: classref-method
|void| **set_object_name**\ (\ object_type\: :ref:`int<class_int>`, object_handle\: :ref:`int<class_int>`, object_name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_set_object_name>`
Set the object name of an OpenXR object, used for debug output. ``object_type`` must be a valid OpenXR ``XrObjectType`` enum and ``object_handle`` must be a valid OpenXR object handle.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_set_render_region:
.. rst-class:: classref-method
|void| **set_render_region**\ (\ render_region\: :ref:`Rect2i<class_Rect2i>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_set_render_region>`
Sets the render region to ``render_region``, overriding the normal render target's rect.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_set_velocity_depth_texture:
.. rst-class:: classref-method
|void| **set_velocity_depth_texture**\ (\ render_target\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_set_velocity_depth_texture>`
Sets the render target of the velocity depth texture.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_set_velocity_target_size:
.. rst-class:: classref-method
|void| **set_velocity_target_size**\ (\ target_size\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_set_velocity_target_size>`
Sets the target size of the velocity and velocity depth textures.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_set_velocity_texture:
.. rst-class:: classref-method
|void| **set_velocity_texture**\ (\ render_target\: :ref:`RID<class_RID>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_set_velocity_texture>`
Sets the render target of the velocity texture.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_transform_from_pose:
.. rst-class:: classref-method
:ref:`Transform3D<class_Transform3D>` **transform_from_pose**\ (\ pose\: ``const void*``\ ) :ref:`🔗<class_OpenXRAPIExtension_method_transform_from_pose>`
Creates a :ref:`Transform3D<class_Transform3D>` from an `XrPosef <https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef.html>`__.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_unregister_composition_layer_provider:
.. rst-class:: classref-method
|void| **unregister_composition_layer_provider**\ (\ extension\: :ref:`OpenXRExtensionWrapperExtension<class_OpenXRExtensionWrapperExtension>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_unregister_composition_layer_provider>`
Unregisters the given extension as a composition layer provider.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_unregister_projection_views_extension:
.. rst-class:: classref-method
|void| **unregister_projection_views_extension**\ (\ extension\: :ref:`OpenXRExtensionWrapperExtension<class_OpenXRExtensionWrapperExtension>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_unregister_projection_views_extension>`
Unregisters the given extension as a provider of additional data structures to projections views.
.. rst-class:: classref-item-separator
----
.. _class_OpenXRAPIExtension_method_xr_result:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **xr_result**\ (\ result\: :ref:`int<class_int>`, format\: :ref:`String<class_String>`, args\: :ref:`Array<class_Array>`\ ) :ref:`🔗<class_OpenXRAPIExtension_method_xr_result>`
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.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
.. |void| replace:: :abbr:`void (No return value.)`