class_openxrfutureextension.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/modules/openxr/doc_classes/OpenXRFutureExtension.xml.
  6. .. _class_OpenXRFutureExtension:
  7. OpenXRFutureExtension
  8. =====================
  9. **Inherits:** :ref:`OpenXRExtensionWrapper<class_OpenXRExtensionWrapper>` **<** :ref:`Object<class_Object>`
  10. The OpenXR Future extension allows for asynchronous APIs to be used.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. .. rst-class:: classref-reftable-group
  16. Methods
  17. -------
  18. .. table::
  19. :widths: auto
  20. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | |void| | :ref:`cancel_future<class_OpenXRFutureExtension_method_cancel_future>`\ (\ future\: :ref:`int<class_int>`\ ) |
  22. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`is_active<class_OpenXRFutureExtension_method_is_active>`\ (\ ) |const| |
  24. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`OpenXRFutureResult<class_OpenXRFutureResult>` | :ref:`register_future<class_OpenXRFutureExtension_method_register_future>`\ (\ future\: :ref:`int<class_int>`, on_success\: :ref:`Callable<class_Callable>` = Callable()\ ) |
  26. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. .. rst-class:: classref-section-separator
  28. ----
  29. .. rst-class:: classref-descriptions-group
  30. Method Descriptions
  31. -------------------
  32. .. _class_OpenXRFutureExtension_method_cancel_future:
  33. .. rst-class:: classref-method
  34. |void| **cancel_future**\ (\ future\: :ref:`int<class_int>`\ ) :ref:`🔗<class_OpenXRFutureExtension_method_cancel_future>`
  35. Cancels an in-progress future. ``future`` must be an ``XrFutureEXT`` value previously returned by an API that started an asynchronous function.
  36. .. rst-class:: classref-item-separator
  37. ----
  38. .. _class_OpenXRFutureExtension_method_is_active:
  39. .. rst-class:: classref-method
  40. :ref:`bool<class_bool>` **is_active**\ (\ ) |const| :ref:`🔗<class_OpenXRFutureExtension_method_is_active>`
  41. Returns ``true`` if futures are available in the OpenXR runtime used. This function will only return a usable result after OpenXR has been initialized.
  42. .. rst-class:: classref-item-separator
  43. ----
  44. .. _class_OpenXRFutureExtension_method_register_future:
  45. .. rst-class:: classref-method
  46. :ref:`OpenXRFutureResult<class_OpenXRFutureResult>` **register_future**\ (\ future\: :ref:`int<class_int>`, on_success\: :ref:`Callable<class_Callable>` = Callable()\ ) :ref:`🔗<class_OpenXRFutureExtension_method_register_future>`
  47. 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.
  48. You can optionally specify ``on_success``, it will be invoked on successful completion of the future.
  49. Or you can use the returned :ref:`OpenXRFutureResult<class_OpenXRFutureResult>` object to ``await`` its :ref:`OpenXRFutureResult.completed<class_OpenXRFutureResult_signal_completed>` signal.
  50. ::
  51. var future_result = OpenXRFutureExtension.register_future(future)
  52. await future_result.completed
  53. if future_result.get_status() == OpenXRFutureResult.RESULT_FINISHED:
  54. # Handle your success
  55. pass
  56. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  57. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  58. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  59. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  60. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  61. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  62. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  63. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  64. .. |void| replace:: :abbr:`void (No return value.)`