Monado OpenXR Runtime
Files | Data Structures | Macros | Typedefs | Enumerations | Functions

Gets called from OpenXR entrypoints functions and talks to devices and Compositor using XRT interfaces. More...

Collaboration diagram for OpenXR main code:

Files

file  oxr_binding.c
 Holds binding related functions.
 
file  oxr_binding_data.h
 Holds shipped binding data.
 
file  oxr_event.c
 Holds event related functions.
 
file  oxr_handle.h
 Contains handle-related functions and defines only required in a few locations.
 
file  oxr_input.c
 Holds input related functions.
 
file  oxr_instance.c
 Holds instance related functions.
 
file  oxr_logger.c
 Logging functions.
 
file  oxr_logger.h
 Logging functions.
 
file  oxr_messenger.c
 Holds debug utils/messenger related functions.
 
file  oxr_objects.h
 Contains the instance struct that a lot of things hang from.
 
file  oxr_path.c
 Holds path related functions.
 
file  oxr_session.c
 Holds session related functions.
 
file  oxr_session_egl.c
 Holds OpenGL-specific session functions.
 
file  oxr_session_gl.c
 Holds OpenGL-specific session functions.
 
file  oxr_session_vk.c
 Holds Vulkan specific session functions.
 
file  oxr_space.c
 So much space!
 
file  oxr_swapchain.c
 Holds swapchain related functions.
 
file  oxr_swapchain_gl.c
 Holds OpenGL swapchain related functions.
 
file  oxr_swapchain_vk.c
 Holds Vulkan swapchain related functions.
 
file  oxr_system.c
 Holds system related entrypoints.
 
file  oxr_two_call.h
 Two call helper functions.
 
file  oxr_verify.c
 File for verifying app input into api functions.
 
file  oxr_vulkan.c
 Holds Vulkan related functions.
 
file  oxr_xdev.c
 Various helpers for accessing xrt_device.
 

Data Structures

struct  oxr_logger
 Logger struct that lives on the stack, one for each call client call. More...
 
struct  oxr_handle_base
 Used to hold diverse child handles and ensure orderly destruction. More...
 
struct  oxr_system
 Single or multiple devices grouped together to form a system that sessions can be created from. More...
 
struct  oxr_extension_status
 Structure tracking which extensions are enabled for a given instance. More...
 
struct  oxr_instance
 Main object that ties everything together. More...
 
struct  oxr_session
 Object that client program interact with. More...
 
struct  oxr_interaction_profile
 A single interaction profile. More...
 
struct  oxr_binding
 Interaction profile binding state. More...
 
struct  oxr_sub_paths
 To carry around a sementic selection of sub action paths. More...
 
struct  oxr_source_set
 Session input source. More...
 
struct  oxr_source_state
 The state of a action input source. More...
 
struct  oxr_source_input
 A input source pair of a xrt_input and a xrt_device. More...
 
struct  oxr_source_output
 A output source pair of a xrt_output_name and a xrt_device. More...
 
struct  oxr_source_cache
 A set of inputs for a single sub action path. More...
 
struct  oxr_source
 Session input source. More...
 
struct  oxr_space
 Can be one of 3 references or a space that are bound to actions. More...
 
struct  oxr_swapchain
 A set of images used for rendering. More...
 
struct  oxr_action_set
 A group of actions. More...
 
struct  oxr_action
 A single action. More...
 
struct  oxr_debug_messenger
 Debug object created by the client program. More...
 
struct  oxr_path
 Internal representation of a path, item follows this struct in memory and that in turn is followed by the string. More...
 

Macros

#define OXR_WARN_ONCE(log, ...)
 Helper macro to log a warning just once. More...
 
#define OXR_XR_DEBUG_INSTANCE   (*(uint64_t *)"oxrinst\0")
 
#define OXR_XR_DEBUG_SESSION   (*(uint64_t *)"oxrsess\0")
 
#define OXR_XR_DEBUG_SPACE   (*(uint64_t *)"oxrspac\0")
 
#define OXR_XR_DEBUG_PATH   (*(uint64_t *)"oxrpath\0")
 
#define OXR_XR_DEBUG_ACTION   (*(uint64_t *)"oxracti\0")
 
#define OXR_XR_DEBUG_SWAPCHAIN   (*(uint64_t *)"oxrswap\0")
 
#define OXR_XR_DEBUG_ACTIONSET   (*(uint64_t *)"oxraset\0")
 
#define OXR_XR_DEBUG_MESSENGER   (*(uint64_t *)"oxrmess\0")
 
#define OXR_XR_DEBUG_SOURCESET   (*(uint64_t *)"oxrsrcs\0")
 
#define OXR_XR_DEBUG_SOURCE   (*(uint64_t *)"oxrsrc_\0")
 
#define XRT_MAX_HANDLE_CHILDREN   256
 
#define MAKE_EXT_STATUS(mixed_case, all_caps)   bool mixed_case;
 

Typedefs

typedef XrResult(* oxr_handle_destroyer) (struct oxr_logger *log, struct oxr_handle_base *hb)
 

Enumerations

enum  oxr_handle_state { OXR_HANDLE_STATE_UNINITIALIZED = 0, OXR_HANDLE_STATE_LIVE, OXR_HANDLE_STATE_DESTROYED }
 State of a handle base, to reduce likelihood of going "boom" on out-of-order destruction or other unsavory behavior. More...
 
enum  oxr_sub_action_path {
  OXR_SUB_ACTION_PATH_USER, OXR_SUB_ACTION_PATH_HEAD, OXR_SUB_ACTION_PATH_LEFT, OXR_SUB_ACTION_PATH_RIGHT,
  OXR_SUB_ACTION_PATH_GAMEPAD
}
 Sub action paths. More...
 

Functions

XrResult oxr_handle_destroy (struct oxr_logger *log, struct oxr_handle_base *hb)
 Destroy the handle's object, as well as all child handles recursively. More...
 
const char * oxr_handle_state_to_string (enum oxr_handle_state state)
 Returns a human-readable label for a handle state. More...
 
XrResult oxr_instance_create (struct oxr_logger *log, const XrInstanceCreateInfo *createInfo, struct oxr_instance **out_inst)
 
XrResult oxr_instance_get_properties (struct oxr_logger *log, struct oxr_instance *inst, XrInstanceProperties *instanceProperties)
 
XrResult oxr_instance_convert_time_to_timespec (struct oxr_logger *log, struct oxr_instance *inst, XrTime time, struct timespec *timespecTime)
 
XrResult oxr_instance_convert_timespec_to_time (struct oxr_logger *log, struct oxr_instance *inst, const struct timespec *timespecTime, XrTime *time)
 
void * oxr_path_get_attached (struct oxr_logger *log, struct oxr_instance *inst, XrPath path)
 
XrResult oxr_path_get_or_create (struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path)
 Get the path for the given string if it exists, or create it if it does not. More...
 
XrResult oxr_path_only_get (struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path)
 Only get the path for the given string if it exists. More...
 
XrResult oxr_path_get_string (struct oxr_logger *log, struct oxr_instance *inst, XrPath path, const char **out_str, size_t *out_length)
 Get a pointer and length of the internal string. More...
 
void oxr_path_destroy_all (struct oxr_logger *log, struct oxr_instance *inst)
 Destroy all paths that the instance has created. More...
 
void oxr_classify_sub_action_paths (struct oxr_logger *log, struct oxr_instance *inst, uint32_t num_subaction_paths, const XrPath *subaction_paths, struct oxr_sub_paths *sub_paths)
 Helper function to classify sub_paths. More...
 
XrResult oxr_source_get_pose_input (struct oxr_logger *log, struct oxr_session *sess, uint32_t key, const struct oxr_sub_paths *sub_paths, struct oxr_source_input **out_input)
 Find the pose input for the set of sub_paths. More...
 
XrResult oxr_action_set_create (struct oxr_logger *log, struct oxr_instance *inst, const XrActionSetCreateInfo *createInfo, struct oxr_action_set **out_act_set)
 
XrResult oxr_action_create (struct oxr_logger *log, struct oxr_action_set *act_set, const XrActionCreateInfo *createInfo, struct oxr_action **out_act)
 
XrResult oxr_session_attach_action_sets (struct oxr_logger *log, struct oxr_session *sess, const XrSessionActionSetsAttachInfo *bindInfo)
 
XrResult oxr_action_sync_data (struct oxr_logger *log, struct oxr_session *sess, uint32_t countActionSets, const XrActiveActionSet *actionSets)
 
XrResult oxr_action_get_boolean (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStateBoolean *data)
 
XrResult oxr_action_get_vector1f (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStateFloat *data)
 
XrResult oxr_action_get_vector2f (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStateVector2f *data)
 
XrResult oxr_action_get_pose (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStatePose *data)
 
XrResult oxr_action_apply_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, const XrHapticBaseHeader *hapticEvent)
 
XrResult oxr_action_stop_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths)
 
void oxr_find_profile_for_device (struct oxr_logger *log, struct oxr_instance *inst, struct xrt_device *xdev, struct oxr_interaction_profile **out_p)
 Find the best matching profile for the given xrt_device. More...
 
void oxr_binding_destroy_all (struct oxr_logger *log, struct oxr_instance *inst)
 Free all memory allocated by the binding system. More...
 
void oxr_binding_find_bindings_from_key (struct oxr_logger *log, struct oxr_interaction_profile *profile, uint32_t key, struct oxr_binding *bindings[32], size_t *num_bindings)
 Find all bindings that is the given action key is bound to. More...
 
XrResult oxr_action_suggest_interaction_profile_bindings (struct oxr_logger *log, struct oxr_instance *inst, const XrInteractionProfileSuggestedBinding *suggestedBindings)
 
XrResult oxr_action_get_current_interaction_profile (struct oxr_logger *log, struct oxr_session *sess, XrPath topLevelUserPath, XrInteractionProfileState *interactionProfile)
 
XrResult oxr_action_get_input_source_localized_name (struct oxr_logger *log, struct oxr_session *sess, const XrInputSourceLocalizedNameGetInfo *getInfo, uint32_t bufferCapacityInput, uint32_t *bufferCountOutput, char *buffer)
 
XrResult oxr_action_enumerate_bound_sources (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, uint32_t sourceCapacityInput, uint32_t *sourceCountOutput, XrPath *sources)
 
XrResult oxr_session_create (struct oxr_logger *log, struct oxr_system *sys, const XrSessionCreateInfo *createInfo, struct oxr_session **out_session)
 
XrResult oxr_session_enumerate_formats (struct oxr_logger *log, struct oxr_session *sess, uint32_t formatCapacityInput, uint32_t *formatCountOutput, int64_t *formats)
 
XrResult oxr_session_begin (struct oxr_logger *log, struct oxr_session *sess, const XrSessionBeginInfo *beginInfo)
 
XrResult oxr_session_end (struct oxr_logger *log, struct oxr_session *sess)
 
XrResult oxr_session_request_exit (struct oxr_logger *log, struct oxr_session *sess)
 
void oxr_session_poll (struct oxr_session *sess)
 
XrResult oxr_session_get_view_pose_at (struct oxr_logger *, struct oxr_session *sess, XrTime at_time, struct xrt_pose *)
 Get the view space position at the given time in relation to the local or stage space. More...
 
XrResult oxr_session_views (struct oxr_logger *log, struct oxr_session *sess, const XrViewLocateInfo *viewLocateInfo, XrViewState *viewState, uint32_t viewCapacityInput, uint32_t *viewCountOutput, XrView *views)
 
XrResult oxr_session_frame_wait (struct oxr_logger *log, struct oxr_session *sess, XrFrameState *frameState)
 
XrResult oxr_session_frame_begin (struct oxr_logger *log, struct oxr_session *sess)
 
XrResult oxr_session_frame_end (struct oxr_logger *log, struct oxr_session *sess, const XrFrameEndInfo *frameEndInfo)
 
XrResult oxr_space_action_create (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, const XrActionSpaceCreateInfo *createInfo, struct oxr_space **out_space)
 
XrResult oxr_space_reference_create (struct oxr_logger *log, struct oxr_session *sess, const XrReferenceSpaceCreateInfo *createInfo, struct oxr_space **out_space)
 
XrResult oxr_space_locate (struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, XrSpaceLocation *location)
 
XrResult oxr_space_ref_relation (struct oxr_logger *log, struct oxr_session *sess, XrReferenceSpaceType space, XrReferenceSpaceType baseSpc, XrTime time, struct xrt_space_relation *out_relation)
 This returns only the relation between two spaces without any of the app given relations applied, assumes that both spaces are reference spaces. More...
 
XrResult oxr_create_swapchain (struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **out_swapchain)
 
XrResult oxr_create_messenger (struct oxr_logger *, struct oxr_instance *inst, const XrDebugUtilsMessengerCreateInfoEXT *, struct oxr_debug_messenger **out_mssngr)
 
XrResult oxr_destroy_messenger (struct oxr_logger *log, struct oxr_debug_messenger *mssngr)
 
XrResult oxr_system_select (struct oxr_logger *log, struct oxr_system **systems, uint32_t num_systems, XrFormFactor form_factor, struct oxr_system **out_selected)
 
XrResult oxr_system_fill_in (struct oxr_logger *log, struct oxr_instance *inst, XrSystemId systemId, struct oxr_system *sys, struct xrt_device **xdevs, size_t num_xdevs)
 
XrResult oxr_system_verify_id (struct oxr_logger *log, const struct oxr_instance *inst, XrSystemId systemId)
 
XrResult oxr_system_get_by_id (struct oxr_logger *log, struct oxr_instance *inst, XrSystemId systemId, struct oxr_system **system)
 
XrResult oxr_system_get_properties (struct oxr_logger *log, struct oxr_system *sys, XrSystemProperties *properties)
 
XrResult oxr_system_enumerate_view_confs (struct oxr_logger *log, struct oxr_system *sys, uint32_t viewConfigurationTypeCapacityInput, uint32_t *viewConfigurationTypeCountOutput, XrViewConfigurationType *viewConfigurationTypes)
 
XrResult oxr_system_enumerate_blend_modes (struct oxr_logger *log, struct oxr_system *sys, XrViewConfigurationType viewConfigurationType, uint32_t environmentBlendModeCapacityInput, uint32_t *environmentBlendModeCountOutput, XrEnvironmentBlendMode *environmentBlendModes)
 
XrResult oxr_system_get_view_conf_properties (struct oxr_logger *log, struct oxr_system *sys, XrViewConfigurationType viewConfigurationType, XrViewConfigurationProperties *configurationProperties)
 
XrResult oxr_system_enumerate_view_conf_views (struct oxr_logger *log, struct oxr_system *sys, XrViewConfigurationType viewConfigurationType, uint32_t viewCapacityInput, uint32_t *viewCountOutput, XrViewConfigurationView *views)
 
XrResult oxr_poll_event (struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData)
 
XrResult oxr_event_push_XrEventDataSessionStateChanged (struct oxr_logger *log, struct oxr_session *sess, XrSessionState state, XrTime time)
 
void oxr_xdev_destroy (struct xrt_device **xdev_ptr)
 
void oxr_xdev_update (struct xrt_device *xdev)
 
bool oxr_xdev_find_input (struct xrt_device *xdev, enum xrt_input_name name, struct xrt_input **out_input)
 Return true if it finds an input of that name on this device. More...
 
bool oxr_xdev_find_output (struct xrt_device *xdev, enum xrt_output_name name, struct xrt_output **out_output)
 Return true if it finds an output of that name on this device. More...
 
void oxr_xdev_get_pose_at (struct oxr_logger *log, struct oxr_instance *inst, struct xrt_device *xdev, enum xrt_input_name name, XrTime at_time, uint64_t *out_pose_timestamp_ns, struct xrt_pose *out_pose)
 Returns the pose of the named input from the device, if the pose isn't valid uses the device offset instead. More...
 
void oxr_xdev_get_relation_at (struct oxr_logger *log, struct oxr_instance *inst, struct xrt_device *xdev, enum xrt_input_name name, XrTime at_time, uint64_t *out_relation_timestamp_ns, struct xrt_space_relation *out_relation)
 Returns the relation of the named input from the device, always ensures that position and orientation is valid by using the device offset. More...
 
XrResult oxr_session_populate_gl_xlib (struct oxr_logger *log, struct oxr_system *sys, XrGraphicsBindingOpenGLXlibKHR const *next, struct oxr_session *sess)
 
XrResult oxr_swapchain_gl_create (struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **out_swapchain)
 
XrResult oxr_vk_get_instance_exts (struct oxr_logger *log, struct oxr_system *sys, uint32_t namesCapacityInput, uint32_t *namesCountOutput, char *namesString)
 
XrResult oxr_vk_get_device_exts (struct oxr_logger *log, struct oxr_system *sys, uint32_t namesCapacityInput, uint32_t *namesCountOutput, char *namesString)
 
XrResult oxr_vk_get_requirements (struct oxr_logger *log, struct oxr_system *sys, XrGraphicsRequirementsVulkanKHR *graphicsRequirements)
 
XrResult oxr_vk_get_physical_device (struct oxr_logger *log, struct oxr_instance *inst, struct oxr_system *sys, VkInstance vkInstance, PFN_vkGetInstanceProcAddr getProc, VkPhysicalDevice *vkPhysicalDevice)
 
XrResult oxr_session_populate_vk (struct oxr_logger *log, struct oxr_system *sys, XrGraphicsBindingVulkanKHR const *next, struct oxr_session *sess)
 
XrResult oxr_swapchain_vk_create (struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **out_swapchain)
 
void oxr_log_init (struct oxr_logger *logger, const char *api_func_name)
 
void oxr_log_set_instance (struct oxr_logger *logger, struct oxr_instance *inst)
 
void oxr_log (struct oxr_logger *logger, const char *fmt,...) XRT_PRINTF_FORMAT(2
 
void void oxr_warn (struct oxr_logger *logger, const char *fmt,...) XRT_PRINTF_FORMAT(2
 
void void XrResult oxr_error (struct oxr_logger *logger, XrResult result, const char *fmt,...) XRT_PRINTF_FORMAT(3
 Output an error and return the result code. More...
 
void oxr_slog (struct oxr_sink_logger *slog, const char *fmt,...)
 Log string to sink logger. More...
 
void oxr_slog_abort (struct oxr_sink_logger *slog)
 Abort logging, frees all internal data. More...
 
void oxr_log_slog (struct oxr_logger *log, struct oxr_sink_logger *slog)
 Flush sink as a log message, frees all internal data. More...
 
void oxr_warn_slog (struct oxr_logger *log, struct oxr_sink_logger *slog)
 Flush sink as a warning message, frees all internal data. More...
 
XrResult oxr_error_slog (struct oxr_logger *log, XrResult res, struct oxr_sink_logger *slog)
 Flush sink as a error message, frees all internal data. More...
 

Detailed Description

Gets called from OpenXR entrypoints functions and talks to devices and Compositor using XRT interfaces.

Macro Definition Documentation

◆ MAKE_EXT_STATUS

#define MAKE_EXT_STATUS (   mixed_case,
  all_caps 
)    bool mixed_case;

◆ OXR_WARN_ONCE

#define OXR_WARN_ONCE (   log,
  ... 
)

#include <state_trackers/oxr/oxr_logger.h>

Value:
do { \
static bool _once = false; \
if (!_once) { \
_once = true; \
oxr_warn(log, __VA_ARGS__); \
} \
} while (false)

Helper macro to log a warning just once.

Referenced by oxr_vk_get_physical_device().

◆ OXR_XR_DEBUG_ACTION

#define OXR_XR_DEBUG_ACTION   (*(uint64_t *)"oxracti\0")

◆ OXR_XR_DEBUG_ACTIONSET

#define OXR_XR_DEBUG_ACTIONSET   (*(uint64_t *)"oxraset\0")

◆ OXR_XR_DEBUG_INSTANCE

#define OXR_XR_DEBUG_INSTANCE   (*(uint64_t *)"oxrinst\0")

◆ OXR_XR_DEBUG_MESSENGER

#define OXR_XR_DEBUG_MESSENGER   (*(uint64_t *)"oxrmess\0")

◆ OXR_XR_DEBUG_PATH

#define OXR_XR_DEBUG_PATH   (*(uint64_t *)"oxrpath\0")

◆ OXR_XR_DEBUG_SESSION

#define OXR_XR_DEBUG_SESSION   (*(uint64_t *)"oxrsess\0")

◆ OXR_XR_DEBUG_SOURCE

#define OXR_XR_DEBUG_SOURCE   (*(uint64_t *)"oxrsrc_\0")

◆ OXR_XR_DEBUG_SOURCESET

#define OXR_XR_DEBUG_SOURCESET   (*(uint64_t *)"oxrsrcs\0")

◆ OXR_XR_DEBUG_SPACE

#define OXR_XR_DEBUG_SPACE   (*(uint64_t *)"oxrspac\0")

◆ OXR_XR_DEBUG_SWAPCHAIN

#define OXR_XR_DEBUG_SWAPCHAIN   (*(uint64_t *)"oxrswap\0")

◆ XRT_MAX_HANDLE_CHILDREN

#define XRT_MAX_HANDLE_CHILDREN   256

Typedef Documentation

◆ oxr_handle_destroyer

typedef XrResult(* oxr_handle_destroyer) (struct oxr_logger *log, struct oxr_handle_base *hb)

Enumeration Type Documentation

◆ oxr_handle_state

#include <state_trackers/oxr/oxr_objects.h>

State of a handle base, to reduce likelihood of going "boom" on out-of-order destruction or other unsavory behavior.

Enumerator
OXR_HANDLE_STATE_UNINITIALIZED 

State during/before oxr_handle_init, or after failure.

OXR_HANDLE_STATE_LIVE 

State after successful oxr_handle_init.

OXR_HANDLE_STATE_DESTROYED 

State after successful oxr_handle_destroy.

◆ oxr_sub_action_path

#include <state_trackers/oxr/oxr_objects.h>

Sub action paths.

Enumerator
OXR_SUB_ACTION_PATH_USER 
OXR_SUB_ACTION_PATH_HEAD 
OXR_SUB_ACTION_PATH_LEFT 
OXR_SUB_ACTION_PATH_RIGHT 
OXR_SUB_ACTION_PATH_GAMEPAD 

Function Documentation

◆ oxr_action_apply_haptic_feedback()

XrResult oxr_action_apply_haptic_feedback ( struct oxr_logger log,
struct oxr_session sess,
uint64_t  key,
struct oxr_sub_paths  sub_paths,
const XrHapticBaseHeader *  hapticEvent 
)

◆ oxr_action_create()

XrResult oxr_action_create ( struct oxr_logger log,
struct oxr_action_set act_set,
const XrActionCreateInfo *  createInfo,
struct oxr_action **  out_act 
)

◆ oxr_action_enumerate_bound_sources()

XrResult oxr_action_enumerate_bound_sources ( struct oxr_logger log,
struct oxr_session sess,
uint64_t  key,
uint32_t  sourceCapacityInput,
uint32_t *  sourceCountOutput,
XrPath *  sources 
)

◆ oxr_action_get_boolean()

XrResult oxr_action_get_boolean ( struct oxr_logger log,
struct oxr_session sess,
uint64_t  key,
struct oxr_sub_paths  sub_paths,
XrActionStateBoolean *  data 
)

◆ oxr_action_get_current_interaction_profile()

XrResult oxr_action_get_current_interaction_profile ( struct oxr_logger log,
struct oxr_session sess,
XrPath  topLevelUserPath,
XrInteractionProfileState *  interactionProfile 
)

◆ oxr_action_get_input_source_localized_name()

XrResult oxr_action_get_input_source_localized_name ( struct oxr_logger log,
struct oxr_session sess,
const XrInputSourceLocalizedNameGetInfo *  getInfo,
uint32_t  bufferCapacityInput,
uint32_t *  bufferCountOutput,
char *  buffer 
)

◆ oxr_action_get_pose()

XrResult oxr_action_get_pose ( struct oxr_logger log,
struct oxr_session sess,
uint64_t  key,
struct oxr_sub_paths  sub_paths,
XrActionStatePose *  data 
)

◆ oxr_action_get_vector1f()

XrResult oxr_action_get_vector1f ( struct oxr_logger log,
struct oxr_session sess,
uint64_t  key,
struct oxr_sub_paths  sub_paths,
XrActionStateFloat *  data 
)

◆ oxr_action_get_vector2f()

XrResult oxr_action_get_vector2f ( struct oxr_logger log,
struct oxr_session sess,
uint64_t  key,
struct oxr_sub_paths  sub_paths,
XrActionStateVector2f *  data 
)

◆ oxr_action_set_create()

XrResult oxr_action_set_create ( struct oxr_logger log,
struct oxr_instance inst,
const XrActionSetCreateInfo *  createInfo,
struct oxr_action_set **  out_act_set 
)

◆ oxr_action_stop_haptic_feedback()

XrResult oxr_action_stop_haptic_feedback ( struct oxr_logger log,
struct oxr_session sess,
uint64_t  key,
struct oxr_sub_paths  sub_paths 
)

◆ oxr_action_suggest_interaction_profile_bindings()

XrResult oxr_action_suggest_interaction_profile_bindings ( struct oxr_logger log,
struct oxr_instance inst,
const XrInteractionProfileSuggestedBinding *  suggestedBindings 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
Still needs to validate the paths.
Todo:
Validate keys FIRST then reset.

Referenced by oxr_xrSuggestInteractionProfileBindings().

◆ oxr_action_sync_data()

XrResult oxr_action_sync_data ( struct oxr_logger log,
struct oxr_session sess,
uint32_t  countActionSets,
const XrActiveActionSet *  actionSets 
)

◆ oxr_binding_destroy_all()

void oxr_binding_destroy_all ( struct oxr_logger log,
struct oxr_instance inst 
)

◆ oxr_binding_find_bindings_from_key()

void oxr_binding_find_bindings_from_key ( struct oxr_logger log,
struct oxr_interaction_profile profile,
uint32_t  key,
struct oxr_binding bindings[32],
size_t *  num_bindings 
)

#include <state_trackers/oxr/oxr_objects.h>

Find all bindings that is the given action key is bound to.

Todo:
This function should be a two call function, or handle more then 32 bindings.

References oxr_interaction_profile::bindings, oxr_binding::keys, oxr_interaction_profile::num_bindings, and oxr_binding::num_keys.

◆ oxr_classify_sub_action_paths()

void oxr_classify_sub_action_paths ( struct oxr_logger log,
struct oxr_instance inst,
uint32_t  num_subaction_paths,
const XrPath *  subaction_paths,
struct oxr_sub_paths sub_paths 
)

◆ oxr_create_messenger()

XrResult oxr_create_messenger ( struct oxr_logger log,
struct oxr_instance inst,
const XrDebugUtilsMessengerCreateInfoEXT *  createInfo,
struct oxr_debug_messenger **  out_mssngr 
)

◆ oxr_create_swapchain()

XrResult oxr_create_swapchain ( struct oxr_logger ,
struct oxr_session sess,
const XrSwapchainCreateInfo *  ,
struct oxr_swapchain **  out_swapchain 
)

◆ oxr_destroy_messenger()

XrResult oxr_destroy_messenger ( struct oxr_logger log,
struct oxr_debug_messenger mssngr 
)

◆ oxr_error()

void void XrResult oxr_error ( struct oxr_logger logger,
XrResult  result,
const char *  fmt,
  ... 
)

#include <state_trackers/oxr/oxr_logger.h>

Output an error and return the result code.

Intended for use in a return statement, to log error information and return the result code in a single line.

Note: The format string is appended to the function name with no spaces, so it should either start with a parenthesized argument name followed by a space and the message, or should start with a space then the message. That is, a format string of "(arg) info" becomes XR_ERROR: xrFunc(arg) info, and a format string of " info msg" becomes XR_ERROR: xrFunc info msg.

◆ oxr_error_slog()

XrResult oxr_error_slog ( struct oxr_logger log,
XrResult  res,
struct oxr_sink_logger slog 
)

#include <state_trackers/oxr/oxr_logger.h>

Flush sink as a error message, frees all internal data.

References oxr_error(), and oxr_sink_logger::store.

◆ oxr_event_push_XrEventDataSessionStateChanged()

XrResult oxr_event_push_XrEventDataSessionStateChanged ( struct oxr_logger log,
struct oxr_session sess,
XrSessionState  state,
XrTime  time 
)

◆ oxr_find_profile_for_device()

void oxr_find_profile_for_device ( struct oxr_logger log,
struct oxr_instance inst,
struct xrt_device xdev,
struct oxr_interaction_profile **  out_p 
)

#include <state_trackers/oxr/oxr_objects.h>

Find the best matching profile for the given xrt_device.

Parameters
logLogger.
instInstance.
xdevCan be null.
[out]out_pReturned interaction profile.
Todo:
A lot more clever selecting the profile here.

References xrt_device::name, and XRT_DEVICE_HYDRA.

Referenced by oxr_session_attach_action_sets().

◆ oxr_handle_destroy()

XrResult oxr_handle_destroy ( struct oxr_logger log,
struct oxr_handle_base hb 
)

#include <state_trackers/oxr/oxr_objects.h>

Destroy the handle's object, as well as all child handles recursively.

This should be how all handle-associated objects are destroyed.

References HANDLE_LIFECYCLE_LOG_SCOPED, and HANDLE_LIFECYCLE_LOG_SCOPED_BEGIN.

Referenced by oxr_xrDestroyAction(), oxr_xrDestroyActionSet(), oxr_xrDestroyDebugUtilsMessengerEXT(), oxr_xrDestroyInstance(), oxr_xrDestroySession(), oxr_xrDestroySpace(), and oxr_xrDestroySwapchain().

◆ oxr_handle_state_to_string()

const char* oxr_handle_state_to_string ( enum oxr_handle_state  state)

#include <state_trackers/oxr/oxr_objects.h>

Returns a human-readable label for a handle state.

References OXR_HANDLE_STATE_DESTROYED, OXR_HANDLE_STATE_LIVE, and OXR_HANDLE_STATE_UNINITIALIZED.

◆ oxr_instance_convert_time_to_timespec()

XrResult oxr_instance_convert_time_to_timespec ( struct oxr_logger log,
struct oxr_instance inst,
XrTime  time,
struct timespec *  timespecTime 
)

◆ oxr_instance_convert_timespec_to_time()

XrResult oxr_instance_convert_timespec_to_time ( struct oxr_logger log,
struct oxr_instance inst,
const struct timespec *  timespecTime,
XrTime *  time 
)

◆ oxr_instance_create()

XrResult oxr_instance_create ( struct oxr_logger log,
const XrInstanceCreateInfo *  createInfo,
struct oxr_instance **  out_inst 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
check if this (and other creates) failed?

References NUM_XDEVS, OXR_ALLOCATE_HANDLE_OR_RETURN, and OXR_XR_DEBUG_INSTANCE.

Referenced by oxr_xrCreateInstance().

◆ oxr_instance_get_properties()

XrResult oxr_instance_get_properties ( struct oxr_logger log,
struct oxr_instance inst,
XrInstanceProperties *  instanceProperties 
)

◆ oxr_log()

void oxr_log ( struct oxr_logger logger,
const char *  fmt,
  ... 
)

◆ oxr_log_init()

void oxr_log_init ( struct oxr_logger logger,
const char *  api_func_name 
)

◆ oxr_log_set_instance()

void oxr_log_set_instance ( struct oxr_logger logger,
struct oxr_instance inst 
)

◆ oxr_log_slog()

void oxr_log_slog ( struct oxr_logger log,
struct oxr_sink_logger slog 
)

#include <state_trackers/oxr/oxr_logger.h>

Flush sink as a log message, frees all internal data.

References oxr_log(), and oxr_sink_logger::store.

◆ oxr_path_destroy_all()

void oxr_path_destroy_all ( struct oxr_logger log,
struct oxr_instance inst 
)

#include <state_trackers/oxr/oxr_objects.h>

Destroy all paths that the instance has created.

References destroy_callback(), oxr_instance::path_store, and u_hashset_clear_and_call_for_each().

◆ oxr_path_get_attached()

void* oxr_path_get_attached ( struct oxr_logger log,
struct oxr_instance inst,
XrPath  path 
)

◆ oxr_path_get_or_create()

XrResult oxr_path_get_or_create ( struct oxr_logger log,
struct oxr_instance inst,
const char *  str,
size_t  length,
XrPath *  out_path 
)

#include <state_trackers/oxr/oxr_objects.h>

Get the path for the given string if it exists, or create it if it does not.

References oxr_instance::path_store, and u_hashset_find_str().

Referenced by oxr_xrStringToPath().

◆ oxr_path_get_string()

XrResult oxr_path_get_string ( struct oxr_logger log,
struct oxr_instance inst,
XrPath  path,
const char **  out_str,
size_t *  out_length 
)

#include <state_trackers/oxr/oxr_objects.h>

Get a pointer and length of the internal string.

The pointer has the same life time as the instance. The length is the number of valid characters, not including the null termination character (but a extra null byte is always reserved at the end so can strings can be given to functions expecting null terminated strings).

Referenced by oxr_classify_sub_action_paths(), oxr_verify_subaction_path_get(), oxr_verify_subaction_path_sync(), and oxr_xrPathToString().

◆ oxr_path_only_get()

XrResult oxr_path_only_get ( struct oxr_logger log,
struct oxr_instance inst,
const char *  str,
size_t  length,
XrPath *  out_path 
)

#include <state_trackers/oxr/oxr_objects.h>

Only get the path for the given string if it exists.

References oxr_instance::path_store, and u_hashset_find_str().

◆ oxr_poll_event()

XrResult oxr_poll_event ( struct oxr_logger log,
struct oxr_instance inst,
XrEventDataBuffer *  eventData 
)

◆ oxr_session_attach_action_sets()

XrResult oxr_session_attach_action_sets ( struct oxr_logger log,
struct oxr_session sess,
const XrSessionActionSetsAttachInfo *  bindInfo 
)

◆ oxr_session_begin()

XrResult oxr_session_begin ( struct oxr_logger log,
struct oxr_session sess,
const XrSessionBeginInfo *  beginInfo 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
we only support a single view config type per system right now

Referenced by oxr_xrBeginSession().

◆ oxr_session_create()

XrResult oxr_session_create ( struct oxr_logger log,
struct oxr_system sys,
const XrSessionCreateInfo *  createInfo,
struct oxr_session **  out_session 
)

◆ oxr_session_end()

XrResult oxr_session_end ( struct oxr_logger log,
struct oxr_session sess 
)

◆ oxr_session_enumerate_formats()

XrResult oxr_session_enumerate_formats ( struct oxr_logger log,
struct oxr_session sess,
uint32_t  formatCapacityInput,
uint32_t *  formatCountOutput,
int64_t *  formats 
)

◆ oxr_session_frame_begin()

XrResult oxr_session_frame_begin ( struct oxr_logger log,
struct oxr_session sess 
)

◆ oxr_session_frame_end()

XrResult oxr_session_frame_end ( struct oxr_logger log,
struct oxr_session sess,
const XrFrameEndInfo *  frameEndInfo 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
More validation?

Referenced by oxr_xrEndFrame().

◆ oxr_session_frame_wait()

XrResult oxr_session_frame_wait ( struct oxr_logger log,
struct oxr_session sess,
XrFrameState *  frameState 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
this should be carefully synchronized, because there may be more than one session per instance.

Referenced by oxr_xrWaitFrame().

◆ oxr_session_get_view_pose_at()

XrResult oxr_session_get_view_pose_at ( struct oxr_logger ,
struct oxr_session sess,
XrTime  at_time,
struct xrt_pose  
)

#include <state_trackers/oxr/oxr_objects.h>

Get the view space position at the given time in relation to the local or stage space.

Todo:
Forcing a fixed amount of prediction for now since devices don't tell us timestamps yet.

References oxr_system::head, oxr_system::inst, oxr_xdev_get_relation_at(), xrt_space_relation::pose, xrt_space_relation::relation_flags, oxr_session::sys, timestamp, XRT_INPUT_GENERIC_HEAD_POSE, XRT_SPACE_RELATION_ANGULAR_VELOCITY_VALID_BIT, XRT_SPACE_RELATION_ORIENTATION_VALID_BIT, and XRT_SPACE_RELATION_POSITION_VALID_BIT.

Referenced by oxr_space_ref_relation().

◆ oxr_session_poll()

void oxr_session_poll ( struct oxr_session sess)

◆ oxr_session_populate_gl_xlib()

XrResult oxr_session_populate_gl_xlib ( struct oxr_logger log,
struct oxr_system sys,
XrGraphicsBindingOpenGLXlibKHR const *  next,
struct oxr_session sess 
)

◆ oxr_session_populate_vk()

XrResult oxr_session_populate_vk ( struct oxr_logger log,
struct oxr_system sys,
XrGraphicsBindingVulkanKHR const *  next,
struct oxr_session sess 
)

◆ oxr_session_request_exit()

XrResult oxr_session_request_exit ( struct oxr_logger log,
struct oxr_session sess 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
start fading out the app.

Referenced by oxr_xrRequestExitSession().

◆ oxr_session_views()

XrResult oxr_session_views ( struct oxr_logger log,
struct oxr_session sess,
const XrViewLocateInfo *  viewLocateInfo,
XrViewState *  viewState,
uint32_t  viewCapacityInput,
uint32_t *  viewCountOutput,
XrView *  views 
)

◆ oxr_slog()

void oxr_slog ( struct oxr_sink_logger slog,
const char *  fmt,
  ... 
)

#include <state_trackers/oxr/oxr_logger.h>

Log string to sink logger.

◆ oxr_slog_abort()

void oxr_slog_abort ( struct oxr_sink_logger slog)

#include <state_trackers/oxr/oxr_logger.h>

Abort logging, frees all internal data.

◆ oxr_source_get_pose_input()

XrResult oxr_source_get_pose_input ( struct oxr_logger log,
struct oxr_session sess,
uint32_t  key,
const struct oxr_sub_paths sub_paths,
struct oxr_source_input **  out_input 
)

#include <state_trackers/oxr/oxr_objects.h>

Find the pose input for the set of sub_paths.

Referenced by oxr_space_action_relation().

◆ oxr_space_action_create()

XrResult oxr_space_action_create ( struct oxr_logger log,
struct oxr_session sess,
uint64_t  key,
const XrActionSpaceCreateInfo *  createInfo,
struct oxr_space **  out_space 
)

◆ oxr_space_locate()

XrResult oxr_space_locate ( struct oxr_logger log,
struct oxr_space spc,
struct oxr_space baseSpc,
XrTime  time,
XrSpaceLocation *  location 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
for longer paths in "space graph" than one edge, this will be a loop.

References oxr_instance::debug_spaces, oxr_system::inst, oxr_space::sess, and oxr_session::sys.

Referenced by oxr_xrLocateSpace().

◆ oxr_space_ref_relation()

XrResult oxr_space_ref_relation ( struct oxr_logger log,
struct oxr_session sess,
XrReferenceSpaceType  space,
XrReferenceSpaceType  baseSpc,
XrTime  time,
struct xrt_space_relation out_relation 
)

◆ oxr_space_reference_create()

XrResult oxr_space_reference_create ( struct oxr_logger log,
struct oxr_session sess,
const XrReferenceSpaceCreateInfo *  createInfo,
struct oxr_space **  out_space 
)

◆ oxr_swapchain_gl_create()

XrResult oxr_swapchain_gl_create ( struct oxr_logger ,
struct oxr_session sess,
const XrSwapchainCreateInfo *  ,
struct oxr_swapchain **  out_swapchain 
)

◆ oxr_swapchain_vk_create()

XrResult oxr_swapchain_vk_create ( struct oxr_logger ,
struct oxr_session sess,
const XrSwapchainCreateInfo *  ,
struct oxr_swapchain **  out_swapchain 
)

◆ oxr_system_enumerate_blend_modes()

XrResult oxr_system_enumerate_blend_modes ( struct oxr_logger log,
struct oxr_system sys,
XrViewConfigurationType  viewConfigurationType,
uint32_t  environmentBlendModeCapacityInput,
uint32_t *  environmentBlendModeCountOutput,
XrEnvironmentBlendMode *  environmentBlendModes 
)

◆ oxr_system_enumerate_view_conf_views()

XrResult oxr_system_enumerate_view_conf_views ( struct oxr_logger log,
struct oxr_system sys,
XrViewConfigurationType  viewConfigurationType,
uint32_t  viewCapacityInput,
uint32_t *  viewCountOutput,
XrViewConfigurationView *  views 
)

◆ oxr_system_enumerate_view_confs()

XrResult oxr_system_enumerate_view_confs ( struct oxr_logger log,
struct oxr_system sys,
uint32_t  viewConfigurationTypeCapacityInput,
uint32_t *  viewConfigurationTypeCountOutput,
XrViewConfigurationType *  viewConfigurationTypes 
)

◆ oxr_system_fill_in()

XrResult oxr_system_fill_in ( struct oxr_logger log,
struct oxr_instance inst,
XrSystemId  systemId,
struct oxr_system sys,
struct xrt_device **  xdevs,
size_t  num_xdevs 
)

◆ oxr_system_get_by_id()

XrResult oxr_system_get_by_id ( struct oxr_logger log,
struct oxr_instance inst,
XrSystemId  systemId,
struct oxr_system **  system 
)

◆ oxr_system_get_properties()

XrResult oxr_system_get_properties ( struct oxr_logger log,
struct oxr_system sys,
XrSystemProperties *  properties 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
conforming implementations must support at leastXR_MIN_COMPOSITION_LAYERS_SUPPORTED layers.

References oxr_system::head, xrt_device::str, and oxr_system::systemId.

Referenced by oxr_xrGetSystemProperties().

◆ oxr_system_get_view_conf_properties()

XrResult oxr_system_get_view_conf_properties ( struct oxr_logger log,
struct oxr_system sys,
XrViewConfigurationType  viewConfigurationType,
XrViewConfigurationProperties *  configurationProperties 
)

◆ oxr_system_select()

XrResult oxr_system_select ( struct oxr_logger log,
struct oxr_system **  systems,
uint32_t  num_systems,
XrFormFactor  form_factor,
struct oxr_system **  out_selected 
)

#include <state_trackers/oxr/oxr_objects.h>

References oxr_error().

Referenced by oxr_xrGetSystem().

◆ oxr_system_verify_id()

XrResult oxr_system_verify_id ( struct oxr_logger log,
const struct oxr_instance inst,
XrSystemId  systemId 
)

◆ oxr_vk_get_device_exts()

XrResult oxr_vk_get_device_exts ( struct oxr_logger log,
struct oxr_system sys,
uint32_t  namesCapacityInput,
uint32_t *  namesCountOutput,
char *  namesString 
)

◆ oxr_vk_get_instance_exts()

XrResult oxr_vk_get_instance_exts ( struct oxr_logger log,
struct oxr_system sys,
uint32_t  namesCapacityInput,
uint32_t *  namesCountOutput,
char *  namesString 
)

◆ oxr_vk_get_physical_device()

XrResult oxr_vk_get_physical_device ( struct oxr_logger log,
struct oxr_instance inst,
struct oxr_system sys,
VkInstance  vkInstance,
PFN_vkGetInstanceProcAddr  getProc,
VkPhysicalDevice *  vkPhysicalDevice 
)

◆ oxr_vk_get_requirements()

XrResult oxr_vk_get_requirements ( struct oxr_logger log,
struct oxr_system sys,
XrGraphicsRequirementsVulkanKHR *  graphicsRequirements 
)

◆ oxr_warn()

void void oxr_warn ( struct oxr_logger logger,
const char *  fmt,
  ... 
)

◆ oxr_warn_slog()

void oxr_warn_slog ( struct oxr_logger log,
struct oxr_sink_logger slog 
)

#include <state_trackers/oxr/oxr_logger.h>

Flush sink as a warning message, frees all internal data.

References oxr_warn(), and oxr_sink_logger::store.

◆ oxr_xdev_destroy()

void oxr_xdev_destroy ( struct xrt_device **  xdev_ptr)

◆ oxr_xdev_find_input()

bool oxr_xdev_find_input ( struct xrt_device xdev,
enum xrt_input_name  name,
struct xrt_input **  out_input 
)

#include <state_trackers/oxr/oxr_objects.h>

Return true if it finds an input of that name on this device.

References xrt_device::inputs, xrt_input::name, and xrt_device::num_inputs.

◆ oxr_xdev_find_output()

bool oxr_xdev_find_output ( struct xrt_device xdev,
enum xrt_output_name  name,
struct xrt_output **  out_output 
)

#include <state_trackers/oxr/oxr_objects.h>

Return true if it finds an output of that name on this device.

References xrt_output::name, xrt_device::num_outputs, and xrt_device::outputs.

◆ oxr_xdev_get_pose_at()

void oxr_xdev_get_pose_at ( struct oxr_logger log,
struct oxr_instance inst,
struct xrt_device xdev,
enum xrt_input_name  name,
XrTime  at_time,
uint64_t *  out_pose_timestamp_ns,
struct xrt_pose out_pose 
)

◆ oxr_xdev_get_relation_at()

void oxr_xdev_get_relation_at ( struct oxr_logger log,
struct oxr_instance inst,
struct xrt_device xdev,
enum xrt_input_name  name,
XrTime  at_time,
uint64_t *  out_relation_timestamp_ns,
struct xrt_space_relation out_relation 
)

#include <state_trackers/oxr/oxr_objects.h>

Returns the relation of the named input from the device, always ensures that position and orientation is valid by using the device offset.

Todo:
Convert at_time to monotonic and give to device.

References xrt_tracking_origin::offset, and xrt_device::tracking_origin.

Referenced by oxr_session_get_view_pose_at(), and oxr_xdev_get_pose_at().

◆ oxr_xdev_update()

void oxr_xdev_update ( struct xrt_device xdev)