Skip to content

Commit a942398

Browse files
Merge pull request #596 from Esri/james/AR_Updates
James/ar updates
2 parents bedb3d0 + f69834d commit a942398

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

augmentedreality/Examples/CppArExample/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <QQmlApplicationEngine>
2828
#include <QSettings>
2929
#include <QSurfaceFormat>
30+
#include <QQuickWindow>
3031

3132
#include <ArcGISRuntimeEnvironment.h>
3233
#include <SceneQuickView.h>
@@ -49,13 +50,13 @@ using namespace Esri::ArcGISRuntime;
4950

5051
int main(int argc, char *argv[])
5152
{
52-
// Enforce OpenGL
53-
qputenv("QSG_RHI_BACKEND", "opengl");
53+
// At this time AR with the ArcGIS Maps SDK for Qt only supports OpenGL
54+
QQuickWindow::setGraphicsApi(QSGRendererInterface::GraphicsApi::OpenGL);
5455

5556
// There are some conflicts between the AR frameworks and the Qt's rendering thread.
5657
// This code enables the non-threaded render loop mode in Qt.
5758
// See SceneView::renderFrame documentation and Qt's documentation
58-
// https://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html#non-threaded-render-loops-basic-and-windows
59+
// https://doc.qt.io/qt-6/qtquick-visualcanvas-scenegraph.html#non-threaded-render-loops-basic-and-windows
5960
// for more information.
6061
#if defined(Q_OS_IOS) || defined(Q_OS_ANDROID)
6162
qputenv("QSG_RENDER_LOOP", "basic");

augmentedreality/Examples/QmlArExample/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <QCommandLineParser>
2323
#include <QDir>
2424
#include <QSurfaceFormat>
25+
#include <QQuickWindow>
2526

2627
#ifdef Q_OS_WIN
2728
#include <Windows.h>
@@ -54,13 +55,13 @@
5455

5556
int main(int argc, char *argv[])
5657
{
57-
// Enforce OpenGL
58-
qputenv("QSG_RHI_BACKEND", "opengl");
58+
// At this time AR with the ArcGIS Maps SDK for Qt only supports OpenGL
59+
QQuickWindow::setGraphicsApi(QSGRendererInterface::GraphicsApi::OpenGL);
5960

6061
// There are some conflicts between the AR frameworks and the Qt's rendering thread.
6162
// This code enables the non-threaded render loop mode in Qt.
6263
// See SceneView::renderFrame documentation and Qt's documentation
63-
// https://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html#non-threaded-render-loops-basic-and-windows
64+
// https://doc.qt.io/qt-6/qtquick-visualcanvas-scenegraph.html#non-threaded-render-loops-basic-and-windows
6465
// for more information.
6566
#if defined(Q_OS_IOS) || defined(Q_OS_ANDROID)
6667
qputenv("QSG_RENDER_LOOP", "basic");

augmentedreality/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ Android 7.0 64-bit (armv8) is the minimum requirement. 32-bit (armv7) is not sup
6262

6363
The latest ArcGIS Maps SDK for Qt is required to use this toolkit component.
6464

65+
The system requirements for the ArcGIS Maps SDK for Qt take precedence over the minimum versions mentioned here.
66+
67+
OpenGL graphics API is required. Metal is not supported. See the [limitations](#Limitations) section below for more details.
68+
6569
## Creating a new AR app using ArcGIS Maps AR toolkit
6670

6771
### Creating a new C++ app
@@ -411,3 +415,12 @@ The following lines of code enable the non-threaded render loop mode in Qt:
411415
qputenv("QSG_RENDER_LOOP", "basic");
412416
#endif
413417
```
418+
419+
## Limitations
420+
421+
AR currently only supports OpenGL. On iOS devices, you must enforce this because the default graphics API on
422+
iOS devices is Metal. Add the following code to your apps:
423+
424+
```cpp
425+
QQuickWindow::setGraphicsApi(QSGRendererInterface::GraphicsApi::OpenGL);
426+
```

uitools/examples/cpp_quick/src/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
//------------------------------------------------------------------------------
3636
int main(int argc, char* argv[])
3737
{
38-
// Enforce OpenGL
39-
qputenv("QSG_RHI_BACKEND", "opengl");
4038

4139
QtWebView::initialize();
4240
QGuiApplication app(argc, argv);

uitools/examples/qml_quick/src/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727

2828
int main(int argc, char* argv[])
2929
{
30-
// Enforce OpenGL
31-
qputenv("QSG_RHI_BACKEND", "opengl");
3230

3331
QtWebView::initialize();
3432
QGuiApplication app(argc, argv);

0 commit comments

Comments
 (0)