Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qopenxrhelpers.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qopenxrhelpers_p.h"
5#include <QDebug>
6
8
9QString OpenXRHelpers::getXrResultAsString(XrResult result, XrInstance instance)
10{
11 QByteArray errorString(XR_MAX_RESULT_STRING_SIZE, 0);
12 xrResultToString(instance, result, errorString.data());
13 errorString.resize(qstrlen(errorString.constData()));
14 return QString::fromUtf8(errorString).trimmed();
15}
16
17bool OpenXRHelpers::checkXrResult(XrResult result, XrInstance instance)
18{
19 if (result != XrResult::XR_SUCCESS) {
20 qWarning().noquote().nospace() << "\n" << getXrResultAsString(result, instance);
21 return false;
22 }
23 return true;
24}
25
\inmodule QtCore
Definition qbytearray.h:57
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:6018
bool checkXrResult(XrResult result, XrInstance instance)
QString getXrResultAsString(XrResult result, XrInstance instance)
Combined button and popup list for selecting options.
size_t qstrlen(const char *str)
#define qWarning
Definition qlogging.h:166
GLuint64EXT * result
[6]