Monado OpenXR Runtime
Loading...
Searching...
No Matches
b_system_devices.c File Reference

Default implementation helpers for xrt_system_devices. More...

#include "b_system_devices.h"
#include "util/u_device.h"
#include "util/u_logging.h"
#include "util/u_misc.h"
#include "xrt/xrt_device.h"
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
Include dependency graph for b_system_devices.c:

Macros

#define XRT_GET_U_HT(HAND)   xsysd->static_roles.hand_tracking.unobstructed.HAND
 
#define XRT_GET_C_HT(HAND)   xsysd->static_roles.hand_tracking.conforming.HAND
 

Functions

static int32_t get_index_for_device (const struct xrt_system_devices *xsysd, const struct xrt_device *xdev)
 
static const char * type_to_small_string (enum xrt_device_feature_type type)
 
static void get_hand_tracking_devices (struct xrt_system_devices *xsysd, enum xrt_hand hand, struct xrt_device *out_ht_xdevs[2])
 
static xrt_result_t set_hand_tracking_enabled (struct xrt_system_devices *xsysd, enum xrt_hand hand, bool enable)
 
static void destroy (struct xrt_system_devices *xsysd)
 
static xrt_result_t get_roles (struct xrt_system_devices *xsysd, struct xrt_system_roles *out_roles)
 
static xrt_result_t feature_inc (struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)
 
static xrt_result_t feature_dec (struct xrt_system_devices *xsysd, enum xrt_device_feature_type type)
 
struct b_system_devicesb_system_devices_allocate (void)
 Allocates a empty b_system_devices to be filled in by the caller, only the destroy function is filled in.
 
void b_system_devices_close (struct xrt_system_devices *xsysd)
 Destroys all devices and clears out the frame context, doesn't free the struct itself, useful for code embedding the system devices struct into other objects where it's not the first member or C++ classes.
 
struct b_system_devices_staticb_system_devices_static_allocate (void)
 Allocates a empty b_system_devices to be filled in by the caller, only the destroy function is filled in.
 
void b_system_devices_static_finalize (struct b_system_devices_static *bsysds, struct xrt_device *left, struct xrt_device *right, struct xrt_device *gamepad)
 Finalizes the static struct with the given input devices, the system devices will always return these devices for the left and right role.
 

Detailed Description

Default implementation helpers for xrt_system_devices.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m