: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/OpenXRFutureExtension.xml. .. _class_OpenXRFutureExtension: OpenXRFutureExtension ===================== **Inherits:** :ref:`OpenXRExtensionWrapper` **<** :ref:`Object` The OpenXR Future extension allows for asynchronous APIs to be used. .. rst-class:: classref-introduction-group Description ----------- This is a support extension in OpenXR that allows other OpenXR extensions to start asynchronous functions and get a callback after this function finishes. It is not intended for consumption within GDScript but can be accessed from GDExtension. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`cancel_future`\ (\ future\: :ref:`int`\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_active`\ (\ ) |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`OpenXRFutureResult` | :ref:`register_future`\ (\ future\: :ref:`int`, on_success\: :ref:`Callable` = Callable()\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_OpenXRFutureExtension_method_cancel_future: .. rst-class:: classref-method |void| **cancel_future**\ (\ future\: :ref:`int`\ ) :ref:`🔗` Cancels an in-progress future. ``future`` must be an ``XrFutureEXT`` value previously returned by an API that started an asynchronous function. .. rst-class:: classref-item-separator ---- .. _class_OpenXRFutureExtension_method_is_active: .. rst-class:: classref-method :ref:`bool` **is_active**\ (\ ) |const| :ref:`🔗` Returns ``true`` if futures are available in the OpenXR runtime used. This function will only return a usable result after OpenXR has been initialized. .. rst-class:: classref-item-separator ---- .. _class_OpenXRFutureExtension_method_register_future: .. rst-class:: classref-method :ref:`OpenXRFutureResult` **register_future**\ (\ future\: :ref:`int`, on_success\: :ref:`Callable` = Callable()\ ) :ref:`🔗` Register an OpenXR Future object so we monitor for completion. ``future`` must be an ``XrFutureEXT`` value previously returned by an API that started an asynchronous function. You can optionally specify ``on_success``, it will be invoked on successful completion of the future. Or you can use the returned :ref:`OpenXRFutureResult` object to ``await`` its :ref:`OpenXRFutureResult.completed` signal. :: var future_result = OpenXRFutureExtension.register_future(future) await future_result.completed if future_result.get_status() == OpenXRFutureResult.RESULT_FINISHED: # Handle your success pass .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |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.)`