mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-14 17:50:06 +00:00
st/oxr: Refactor input type to string into header [NFC]
This commit is contained in:
parent
6b8728a95b
commit
291d0163b6
src/xrt/state_trackers/oxr
|
@ -16,6 +16,12 @@
|
|||
#include "xrt/xrt_openxr_includes.h"
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Space things.
|
||||
*
|
||||
*/
|
||||
|
||||
static inline XrSpaceLocationFlags
|
||||
xrt_to_xr_space_location_flags(enum xrt_space_relation_flags relation_flags)
|
||||
{
|
||||
|
@ -129,3 +135,26 @@ oxr_ref_space_to_xrt(enum oxr_space_type space_type)
|
|||
|
||||
return XRT_SPACE_REFERENCE_TYPE_INVALID;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* IO things.
|
||||
*
|
||||
*/
|
||||
|
||||
static inline const char *
|
||||
xrt_input_type_to_str(enum xrt_input_type type)
|
||||
{
|
||||
// clang-format off
|
||||
switch (type) {
|
||||
case XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE: return "XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE";
|
||||
case XRT_INPUT_TYPE_VEC1_MINUS_ONE_TO_ONE: return "XRT_INPUT_TYPE_VEC1_MINUS_ONE_TO_ONE";
|
||||
case XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE: return "XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE";
|
||||
case XRT_INPUT_TYPE_VEC3_MINUS_ONE_TO_ONE: return "XRT_INPUT_TYPE_VEC3_MINUS_ONE_TO_ONE";
|
||||
case XRT_INPUT_TYPE_BOOLEAN: return "XRT_INPUT_TYPE_BOOLEAN";
|
||||
case XRT_INPUT_TYPE_POSE: return "XRT_INPUT_TYPE_POSE";
|
||||
default: return "XRT_INPUT_UNKNOWN";
|
||||
}
|
||||
// clang-format on
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "oxr_input_transform.h"
|
||||
#include "oxr_logger.h"
|
||||
#include "oxr_objects.h"
|
||||
#include "oxr_conversions.h"
|
||||
|
||||
#include "util/u_misc.h"
|
||||
|
||||
|
@ -36,22 +37,6 @@ xr_action_type_to_str(XrActionType type)
|
|||
// clang-format on
|
||||
}
|
||||
|
||||
static const char *
|
||||
xrt_input_type_to_str(enum xrt_input_type type)
|
||||
{
|
||||
// clang-format off
|
||||
switch (type) {
|
||||
case XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE: return "XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE";
|
||||
case XRT_INPUT_TYPE_VEC1_MINUS_ONE_TO_ONE: return "XRT_INPUT_TYPE_VEC1_MINUS_ONE_TO_ONE";
|
||||
case XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE: return "XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE";
|
||||
case XRT_INPUT_TYPE_VEC3_MINUS_ONE_TO_ONE: return "XRT_INPUT_TYPE_VEC3_MINUS_ONE_TO_ONE";
|
||||
case XRT_INPUT_TYPE_BOOLEAN: return "XRT_INPUT_TYPE_BOOLEAN";
|
||||
case XRT_INPUT_TYPE_POSE: return "XRT_INPUT_TYPE_POSE";
|
||||
default: return "XRT_INPUT_UNKNOWN";
|
||||
}
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
/*!
|
||||
* Arbitrary but larger than required.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue