Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qopenxrhelpers.cpp
Go to the documentation of this file.
1
// Copyright (C) 2024 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
6
#
include
"qopenxrhelpers_p.h"
7
#
include
<
QDebug
>
8
9
QT_BEGIN_NAMESPACE
10
11
QString OpenXRHelpers::getXrResultAsString(XrResult result, XrInstance instance)
12
{
13
QByteArray errorString(XR_MAX_RESULT_STRING_SIZE, 0);
14
xrResultToString(instance, result, errorString.data());
15
errorString.resize(qstrlen(errorString.constData()));
16
return
QString::fromUtf8(errorString).trimmed();
17
}
18
19
bool
OpenXRHelpers
::checkXrResult(XrResult result, XrInstance instance)
20
{
21
if
(result != XrResult::XR_SUCCESS) {
22
qWarning().noquote().nospace() <<
"OpenXR call failed ("
<< result <<
"): "
<< getXrResultAsString(result, instance);
23
return
false
;
24
}
25
return
true
;
26
}
27
28
bool
OpenXRHelpers
::resolveXrFunction(XrInstance instance,
const
char
*name, PFN_xrVoidFunction *function)
29
{
30
XrResult result = xrGetInstanceProcAddr(instance, name, function);
31
if
(!checkXrResult(result, instance)) {
32
qWarning(
"Failed to resolve OpenXR function %s"
, name);
33
*function =
nullptr
;
34
return
false
;
35
}
36
return
true
;
37
}
38
39
QT_END_NAMESPACE
OpenXRHelpers
Definition
qopenxrhelpers_p.h:30
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtquick3d
src
xr
quick3dxr
openxr
qopenxrhelpers.cpp
Generated on
for Qt by
1.18.0