Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
OpenXRHelpers Namespace Reference

Functions

QString getXrResultAsString (XrResult result, XrInstance instance)
bool checkXrResult (XrResult result, XrInstance instance)
bool resolveXrFunction (XrInstance instance, const char *name, PFN_xrVoidFunction *function)
QQuaternion toQQuaternion (const XrQuaternionf &q)
QVector3D toQVector (const XrVector3f &v)
template<typename T>
XrResult safeCall ()
 Safe call to OpenXR function.
template<typename... A>
XrResult safeCall (XrResult(XRAPI_PTR *f)(A...), A... args)

Function Documentation

◆ checkXrResult()

bool OpenXRHelpers::checkXrResult ( XrResult result,
XrInstance instance )

Definition at line 17 of file qopenxrhelpers.cpp.

Referenced by QOpenXRGraphicsD3D11::setupGraphics(), QOpenXRGraphicsD3D12::setupGraphics(), QOpenXRGraphicsMetal::setupGraphics(), QOpenXRGraphicsOpenGL::setupGraphics(), QOpenXRGraphicsOpenGLES::setupGraphics(), and QOpenXRGraphicsVulkan::setupGraphics().

Here is the caller graph for this function:

◆ getXrResultAsString()

QT_BEGIN_NAMESPACE QString OpenXRHelpers::getXrResultAsString ( XrResult result,
XrInstance instance )

Definition at line 9 of file qopenxrhelpers.cpp.

◆ resolveXrFunction()

bool OpenXRHelpers::resolveXrFunction ( XrInstance instance,
const char * name,
PFN_xrVoidFunction * function )

Definition at line 26 of file qopenxrhelpers.cpp.

◆ safeCall() [1/2]

template<typename T>
XrResult OpenXRHelpers::safeCall ( )
nodiscard

Safe call to OpenXR function.

Parameters
f- OpenXR function pointer that returns a XrResult
args- arguments for the function pointed to by f
Returns
a XrResult indicating the result of the function call.
Note
This function is used to "safely" call OpenXR functions without having to check if the function pointer is nullptr. If the function pointer is nullptr XR_ERROR_FUNCTION_UNSUPPORTED is returned.
If the function returns XR_ERROR_FUNCTION_UNSUPPORTED the caller should avoid calling the function again.

◆ safeCall() [2/2]

template<typename... A>
XrResult OpenXRHelpers::safeCall ( XrResult(XRAPI_PTR *f)(A...) ,
A... args )
nodiscard

Definition at line 58 of file qopenxrhelpers_p.h.

◆ toQQuaternion()

QQuaternion OpenXRHelpers::toQQuaternion ( const XrQuaternionf & q)
inline

Definition at line 33 of file qopenxrhelpers_p.h.

◆ toQVector()

QVector3D OpenXRHelpers::toQVector ( const XrVector3f & v)
inline

Definition at line 38 of file qopenxrhelpers_p.h.