#pragma once
#include <openxr/openxr.h>
#include <string>
#include <stdint.h>
inline std::string to_hex(const uint8_t* const data, size_t bytes) { … }
template <typename T>
inline std::string to_hex(const T& data) { … }
#if XR_PTR_SIZE == 8
template <typename T>
static inline uint64_t MakeHandleGeneric(T handle) { … }
template <typename T>
static inline T& TreatIntegerAsHandle(uint64_t& handle) { … }
template <typename T>
static inline T const& TreatIntegerAsHandle(uint64_t const& handle) { … }
static inline bool IsIntegerNullHandle(uint64_t handle) { … }
#else
static inline uint64_t MakeHandleGeneric(uint64_t handle) { return handle; }
template <typename T>
static inline T& TreatIntegerAsHandle(uint64_t& handle) {
return handle;
}
template <typename T>
static inline T const& TreatIntegerAsHandle(uint64_t const& handle) {
return handle;
}
static inline bool IsIntegerNullHandle(uint64_t handle) { return XR_NULL_HANDLE == handle; }
#endif
inline std::string Uint64ToHexString(uint64_t val) { … }
inline std::string Uint32ToHexString(uint32_t val) { … }
template <typename T>
inline std::string HandleToHexString(T handle) { … }
inline std::string UintptrToHexString(uintptr_t val) { … }
template <typename T>
inline std::string PointerToHexString(T const* ptr) { … }