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 verifing 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, struct time_state *timekeeping)
 
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, struct xrt_pose *pose, int64_t *timestamp)
 
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

◆ 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.

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.

Function Documentation

◆ 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 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
Implement

References oxr_error().

◆ 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 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
Implement

References oxr_error().

◆ 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 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
Implement more fully.

References OXR_ALLOCATE_HANDLE_OR_RETURN.

◆ 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.

◆ oxr_binding_destroy_all()

void oxr_binding_destroy_all ( struct oxr_logger log,
struct oxr_instance inst 
)

#include <state_trackers/oxr/oxr_objects.h>

Free all memory allocated by the binding system.

◆ 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.

◆ 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 
)

#include <state_trackers/oxr/oxr_objects.h>

Helper function to classify sub_paths.

References oxr_path_get_string(), and U_ZERO.

◆ oxr_create_messenger()

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

#include <state_trackers/oxr/oxr_objects.h>

Todo:
call into inst to create this instead?

◆ 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().

◆ 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.

◆ 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.

◆ 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_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?

◆ 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.

◆ 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 oxr_instance::path_store, and u_hashset_clear_and_call_for_each().

◆ 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.

◆ 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(), and oxr_verify_subaction_path_sync().

◆ 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.

◆ 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

◆ 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?

◆ 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.

◆ 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 xrt_tracking_origin::offset, and xrt_device::tracking_origin.

◆ 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.

◆ 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 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
Do not hardcode IPD.

References oxr_space::is_reference.

◆ 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.

◆ 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_space::sess.

◆ 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 
)

#include <state_trackers/oxr/oxr_objects.h>

This returns only the relation between two spaces without any of the app given relations applied, assumes that both spaces are reference spaces.

◆ 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 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
Take into account viewConfigurationType

◆ 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 xrt_device::str.

◆ 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.

◆ 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, 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_device::num_outputs, and xrt_device::outputs.