0.2.0-dev Download ZIP
43 lines ·2.2 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="OpenXRFutureExtension" inherits="OpenXRExtensionWrapper" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> |
| 3 | <brief_description> |
| 4 | The OpenXR Future extension allows for asynchronous APIs to be used. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | 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. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | </tutorials> |
| 11 | <methods> |
| 12 | <method name="cancel_future"> |
| 13 | <return type="void" /> |
| 14 | <param index="0" name="future" type="int" /> |
| 15 | <description> |
| 16 | Cancels an in-progress future. [param future] must be an [code]XrFutureEXT[/code] value previously returned by an API that started an asynchronous function. |
| 17 | </description> |
| 18 | </method> |
| 19 | <method name="is_active" qualifiers="const"> |
| 20 | <return type="bool" /> |
| 21 | <description> |
| 22 | Returns [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. |
| 23 | </description> |
| 24 | </method> |
| 25 | <method name="register_future"> |
| 26 | <return type="OpenXRFutureResult" /> |
| 27 | <param index="0" name="future" type="int" /> |
| 28 | <param index="1" name="on_success" type="Callable" default="Callable()" /> |
| 29 | <description> |
| 30 | Register 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. |
| 31 | You can optionally specify [param on_success], it will be invoked on successful completion of the future. |
| 32 | Or you can use the returned [OpenXRFutureResult] object to [code]await[/code] its [signal OpenXRFutureResult.completed] signal. |
| 33 | [codeblock] |
| 34 | var future_result = OpenXRFutureExtension.register_future(future) |
| 35 | await future_result.completed |
| 36 | if future_result.get_status() == OpenXRFutureResult.RESULT_FINISHED: |
| 37 | # Handle your success |
| 38 | pass |
| 39 | [/codeblock] |
| 40 | </description> |
| 41 | </method> |
| 42 | </methods> |
| 43 | </class> |