Monado OpenXR Runtime
|
This interface acts as a root object for Monado. More...
#include <xrt/xrt_instance.h>
Static Public Member Functions | |
static xrt_result_t | xrt_instance_create_system (struct xrt_instance *xinst, struct xrt_system **out_xsys, struct xrt_system_devices **out_xsysd, struct xrt_space_overseer **out_xso, struct xrt_system_compositor **out_xsysc) |
Creates all of the system resources like the devices and system compositor. More... | |
static xrt_result_t | xrt_instance_get_prober (struct xrt_instance *xinst, struct xrt_prober **out_xp) |
Get the instance xrt_prober, if any. More... | |
static void | xrt_instance_destroy (struct xrt_instance **xinst_ptr) |
Destroy an xrt_instance - helper function. More... | |
Data Fields | |
struct xrt_instance_info | instance_info |
Instance information structure, including both platform and application info. More... | |
int64_t | startup_timestamp |
CLOCK_MONOTONIC timestamp of the instance startup. More... | |
struct xrt_instance_android * | android_instance |
An "aspect" of the xrt_instance interface, used only on Android. More... | |
Interface Methods | |
All implementations of the xrt_instance interface must populate all these function pointers with their implementation methods. To use this interface, see the helper functions. | |
xrt_result_t(* | create_system )(struct xrt_instance *xinst, struct xrt_system **out_xsys, struct xrt_system_devices **out_xsysd, struct xrt_space_overseer **out_xso, struct xrt_system_compositor **out_xsysc) |
Creates all of the system resources like the devices and system compositor. More... | |
xrt_result_t(* | get_prober )(struct xrt_instance *xinst, struct xrt_prober **out_xp) |
Get the instance xrt_prober, if any. More... | |
void(* | destroy )(struct xrt_instance *xinst) |
Destroy the instance and its owned objects, including the prober (if any). More... | |
Related Functions | |
(Note that these are not member functions.) | |
Factory | |
Implemented in each target. | |
xrt_result_t | xrt_instance_create (struct xrt_instance_info *ii, struct xrt_instance **out_xinst) |
Create an implementation of the xrt_instance interface. More... | |
This interface acts as a root object for Monado.
It typically either wraps an xrt_prober or forms a connection to an out-of-process XR service.
This is as close to a singleton object as there is in Monado: you should not create more than one xrt_instance implementation per process.
Each "target" will provide its own (private) implementation of this interface, which is exposed by implementing xrt_instance_create().
Additional information can be found in Understanding and Writing Targets: Connecting the Pieces.
struct xrt_instance_android* xrt_instance::android_instance |
An "aspect" of the xrt_instance interface, used only on Android.
Referenced by android_instance_base::android_instance_base_cleanup().
xrt_result_t(* xrt_instance::create_system) (struct xrt_instance *xinst, struct xrt_system **out_xsys, struct xrt_system_devices **out_xsysd, struct xrt_space_overseer **out_xso, struct xrt_system_compositor **out_xsysc) |
Creates all of the system resources like the devices and system compositor.
The system compositor is optional.
Should only be called once.
xinst | Pointer to self | |
[out] | out_xsys | Return of system, required. |
[out] | out_xsysd | Return of devices, required. |
[out] | out_xsysc | Return of system compositor, optional. |
Referenced by sdl_instance_init(), and xrt_instance_create_system().
void(* xrt_instance::destroy) (struct xrt_instance *xinst) |
Destroy the instance and its owned objects, including the prober (if any).
Code consuming this interface should use xrt_instance_destroy().
xinst | Pointer to self |
Referenced by xrt_instance_destroy().
xrt_result_t(* xrt_instance::get_prober) (struct xrt_instance *xinst, struct xrt_prober **out_xp) |
Get the instance xrt_prober, if any.
If the instance is not using an xrt_prober, it may return null.
The instance retains ownership of the prober and is responsible for destroying it.
Can be called multiple times. (The prober is usually created at instance construction time.)
xinst | Pointer to self | |
[out] | out_xp | Pointer to xrt_prober pointer, will be populated or set to NULL. |
Referenced by xrt_instance_get_prober().
struct xrt_instance_info xrt_instance::instance_info |
Instance information structure, including both platform and application info.
int64_t xrt_instance::startup_timestamp |
CLOCK_MONOTONIC timestamp of the instance startup.