15
src/common.h
Normal file
15
src/common.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <format>
|
||||
|
||||
#define OPENXR_CHECK(fn_call, ...) \
|
||||
do { \
|
||||
XrResult result = fn_call(__VA_ARGS__); \
|
||||
if (result != XR_SUCCESS) { \
|
||||
std::array<char, XR_MAX_RESULT_STRING_SIZE> msg {}; \
|
||||
xrResultToString(nullptr, result, msg.data()); \
|
||||
throw std::runtime_error( \
|
||||
std::format("OpenXR call '{}' failed (code {}): {}", #fn_call, \
|
||||
static_cast<int>(result), msg.data())); \
|
||||
} \
|
||||
} while (0)
|
||||
Reference in New Issue
Block a user