#ifndef OPENXR_DEBUG_HPP #define OPENXR_DEBUG_HPP #include #include namespace MWVR { namespace VrDebug { //! Translates an OpenXR object to the associated XrObjectType enum value template XrObjectType getObjectType(T t); //! Associates a name with an OpenXR symbol if XR_EXT_debug_utils is enabled template void setName(T t, const std::string& name); //! Associates a name with an OpenXR symbol if XR_EXT_debug_utils is enabled void setName(uint64_t handle, XrObjectType type, const std::string& name); } } template inline void MWVR::VrDebug::setName(T t, const std::string& name) { setName(reinterpret_cast(t), getObjectType(t), name); } template<> inline XrObjectType MWVR::VrDebug::getObjectType(XrInstance) { return XR_OBJECT_TYPE_INSTANCE; } template<> inline XrObjectType MWVR::VrDebug::getObjectType(XrSession) { return XR_OBJECT_TYPE_SESSION; } template<> inline XrObjectType MWVR::VrDebug::getObjectType(XrSpace) { return XR_OBJECT_TYPE_SPACE; } template<> inline XrObjectType MWVR::VrDebug::getObjectType(XrActionSet) { return XR_OBJECT_TYPE_ACTION_SET; } template<> inline XrObjectType MWVR::VrDebug::getObjectType(XrAction) { return XR_OBJECT_TYPE_ACTION; } template<> inline XrObjectType MWVR::VrDebug::getObjectType(XrDebugUtilsMessengerEXT) { return XR_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT; } template<> inline XrObjectType MWVR::VrDebug::getObjectType(XrSpatialAnchorMSFT) { return XR_OBJECT_TYPE_SPATIAL_ANCHOR_MSFT; } template<> inline XrObjectType MWVR::VrDebug::getObjectType(XrHandTrackerEXT) { return XR_OBJECT_TYPE_HAND_TRACKER_EXT; } template inline XrObjectType MWVR::VrDebug::getObjectType(T t) { return XR_OBJECT_TYPE_UNKNOWN; } #endif