Plasma Engine  2.0
Loading...
Searching...
No Matches
OpenXRDeclarations.h
1#pragma once
2
3#define XR_LOG_ERROR(code) \
4 do \
5 { \
6 auto s = (code); \
7 if (s != XR_SUCCESS) \
8 { \
9 plLog::Error("OpenXR call '{0}' failed with: {1} in {2}:{3}", PL_PP_STRINGIFY(code), s, PL_SOURCE_FILE, PL_SOURCE_LINE); \
10 } \
11 } while (false)
12
13#define XR_SUCCEED_OR_RETURN_LOG(code) \
14 do \
15 { \
16 auto s = (code); \
17 if (s != XR_SUCCESS) \
18 { \
19 plLog::Error("OpenXR call '{0}' failed with: {1} in {2}:{3}", PL_PP_STRINGIFY(code), s, PL_SOURCE_FILE, PL_SOURCE_LINE); \
20 return s; \
21 } \
22 } while (false)
23
24#define XR_SUCCEED_OR_CLEANUP_LOG(code, cleanup) \
25 do \
26 { \
27 auto s = (code); \
28 if (s != XR_SUCCESS) \
29 { \
30 plLog::Error("OpenXR call '{0}' failed with: {1} in {2}:{3}", PL_PP_STRINGIFY(code), s, PL_SOURCE_FILE, PL_SOURCE_LINE); \
31 cleanup(); \
32 return s; \
33 } \
34 } while (false)
35
36static void voidFunction() {}