diff options
Diffstat (limited to 'src/extras/defaults/qt3dwindow.cpp')
-rw-r--r-- | src/extras/defaults/qt3dwindow.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/extras/defaults/qt3dwindow.cpp b/src/extras/defaults/qt3dwindow.cpp index 19186978e..689a0e37e 100644 --- a/src/extras/defaults/qt3dwindow.cpp +++ b/src/extras/defaults/qt3dwindow.cpp @@ -222,11 +222,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept } else if (userRequestedApi == QByteArrayLiteral("null")) { api = Qt3DRender::API::Null; } else if (userRequestedApi == QByteArrayLiteral("auto")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) api = Qt3DRender::API::RHI; -#else - api = Qt3DRender::API::OpenGL; -#endif } } @@ -235,7 +231,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept // backend is in use will get a valid value. bool useRhi = false; if (qEnvironmentVariableIsEmpty("QT3D_RENDERER")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && QT_CONFIG(qt3d_rhi_renderer) +#if QT_CONFIG(qt3d_rhi_renderer) qputenv("QT3D_RENDERER", "rhi"); #else qputenv("QT3D_RENDERER", "opengl"); @@ -268,7 +264,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept break; case Qt3DRender::API::DirectX: qputenv("QSG_RHI_BACKEND", "d3d11"); - window->setSurfaceType(QSurface::OpenGLSurface); + window->setSurfaceType(QSurface::Direct3DSurface); break; case Qt3DRender::API::Null: qputenv("QSG_RHI_BACKEND", "null"); @@ -304,13 +300,11 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept format.setProfile(QSurfaceFormat::CoreProfile); } #endif - } else { - // This is used for RHI - format.setVersion(1, 0); } format.setDepthBufferSize(24); - format.setSamples(4); + if (!QSurfaceFormat::defaultFormat().stereo()) + format.setSamples(4); format.setStencilBufferSize(8); window->setFormat(format); QSurfaceFormat::setDefaultFormat(format); |