Skyscraper 2.0
XrError.h File Reference
#include <memory>
#include <stdexcept>
#include <stdarg.h>
#include "XrToString.h"
Include dependency graph for XrError.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  xr
 The xr::DispatchTable struct contains all available PFN pointers to xr functions including those in all extensions. The application should call dispatchTable.Initialize() once creating a new XrInstance to initialize all function pointers. The application should reset the dispatch table by = {} when destroying the instance handle.
 
namespace  xr::detail
 

Macros

#define CHECK_XRCMD(cmd)   xr::detail::_CheckXrResult(cmd, #cmd, FILE_AND_LINE)
 
#define CHECK_XRRESULT(res, cmdStr)   xr::detail::_CheckXrResult(res, cmdStr, FILE_AND_LINE)
 
#define CHECK_HRCMD(cmd)   xr::detail::_CheckHResult(cmd, #cmd, FILE_AND_LINE)
 
#define CHECK_HRESULT(res, cmdStr)   xr::detail::_CheckHResult(res, cmdStr, FILE_AND_LINE)
 
#define DEBUG_PRINT(...)   ::OutputDebugStringA((xr::detail::_Fmt(__VA_ARGS__) + "\n").c_str())
 
#define CHK_STRINGIFY(x)   #x
 
#define TOSTRING(x)   CHK_STRINGIFY(x)
 
#define FILE_AND_LINE   __FILE__ ":" TOSTRING(__LINE__)
 
#define THROW(msg)   xr::detail::_Throw(msg, nullptr, FILE_AND_LINE)
 
#define CHECK(exp)
 
#define CHECK_MSG(exp, msg)
 

Functions

std::string xr::detail::_Fmt (const char *fmt,...)
 
void xr::detail::_Throw (std::string failureMessage, const char *originator=nullptr, const char *sourceLocation=nullptr)
 
void xr::detail::_ThrowXrResult (XrResult res, const char *originator=nullptr, const char *sourceLocation=nullptr)
 
XrResult xr::detail::_CheckXrResult (XrResult res, const char *originator=nullptr, const char *sourceLocation=nullptr)
 

Macro Definition Documentation

◆ CHECK

◆ CHECK_HRCMD

#define CHECK_HRCMD ( cmd)    xr::detail::_CheckHResult(cmd, #cmd, FILE_AND_LINE)

Definition at line 17 of file XrError.h.

Referenced by Ogre::OpenXRRenderWindow::_beginUpdate().

◆ CHECK_HRESULT

#define CHECK_HRESULT ( res,
cmdStr )   xr::detail::_CheckHResult(res, cmdStr, FILE_AND_LINE)

Definition at line 18 of file XrError.h.

◆ CHECK_MSG

#define CHECK_MSG ( exp,
msg )
Value:
{ \
if (!(exp)) { \
xr::detail::_Throw(msg, #exp, FILE_AND_LINE); \
} \
}

Definition at line 65 of file XrError.h.

◆ CHECK_XRCMD

◆ CHECK_XRRESULT

#define CHECK_XRRESULT ( res,
cmdStr )   xr::detail::_CheckXrResult(res, cmdStr, FILE_AND_LINE)

Definition at line 15 of file XrError.h.

Referenced by Ogre::OpenXRState::InitializeSystem().

◆ CHK_STRINGIFY

#define CHK_STRINGIFY ( x)    #x

Definition at line 23 of file XrError.h.

◆ DEBUG_PRINT

#define DEBUG_PRINT ( ...)    ::OutputDebugStringA((xr::detail::_Fmt(__VA_ARGS__) + "\n").c_str())

Definition at line 20 of file XrError.h.

Referenced by Ogre::OpenXRRenderWindow::ProcessOpenXREvents().

◆ FILE_AND_LINE

#define FILE_AND_LINE   __FILE__ ":" TOSTRING(__LINE__)

Definition at line 25 of file XrError.h.

◆ THROW

#define THROW ( msg)    xr::detail::_Throw(msg, nullptr, FILE_AND_LINE)

Definition at line 58 of file XrError.h.

Referenced by Ogre::OpenXRState::SelectSwapchainPixelFormats().

◆ TOSTRING

#define TOSTRING ( x)    CHK_STRINGIFY(x)

Definition at line 24 of file XrError.h.