Path: blob/master/modules/openxr/doc_classes/OpenXRFutureExtension.xml
10278 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="OpenXRFutureExtension" inherits="OpenXRExtensionWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">2<brief_description>3The OpenXR Future extension allows for asynchronous APIs to be used.4</brief_description>5<description>6This 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.7</description>8<tutorials>9</tutorials>10<methods>11<method name="cancel_future">12<return type="void" />13<param index="0" name="future" type="int" />14<description>15Cancels an in-progress future. [param future] must be an [code]XrFutureEXT[/code] value previously returned by an API that started an asynchronous function.16</description>17</method>18<method name="is_active" qualifiers="const">19<return type="bool" />20<description>21Returns [code]true[/code] if futures are available in the OpenXR runtime used. This function will only return a usable result after OpenXR has been initialized.22</description>23</method>24<method name="register_future">25<return type="OpenXRFutureResult" />26<param index="0" name="future" type="int" />27<param index="1" name="on_success" type="Callable" default="Callable()" />28<description>29Register an OpenXR Future object so we monitor for completion. [param future] must be an [code]XrFutureEXT[/code] value previously returned by an API that started an asynchronous function.30You can optionally specify [param on_success], it will be invoked on successful completion of the future.31Or you can use the returned [OpenXRFutureResult] object to [code]await[/code] its [signal OpenXRFutureResult.completed] signal.32[codeblock]33var future_result = OpenXRFutureExtension.register_future(future)34await future_result.completed35if future_result.get_status() == OpenXRFutureResult.RESULT_FINISHED:36# Handle your success37pass38[/codeblock]39</description>40</method>41</methods>42</class>434445