diff options
35 files changed, 768 insertions, 4 deletions
diff --git a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp index 9a5556df0..a128647f7 100644 --- a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp +++ b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp @@ -115,6 +115,7 @@ #include <Qt3DRender/qblitframebuffer.h> #include <Qt3DRender/qsetfence.h> #include <Qt3DRender/qwaitfence.h> +#include <Qt3DRender/qrastermode.h> #include <QtGui/qwindow.h> @@ -309,6 +310,7 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri) qmlRegisterType<Qt3DRender::QStencilOperation>(uri, 2, 0, "StencilOperation"); qmlRegisterType<Qt3DRender::QStencilMask>(uri, 2, 0, "StencilMask"); qmlRegisterType<Qt3DRender::QLineWidth>(uri, 2, 10, "LineWidth"); + qmlRegisterType<Qt3DRender::QRasterMode>(uri, 2, 13, "RasterMode"); // Auto-increment the import to stay in sync with ALL future Qt minor versions qmlRegisterModule(uri, 2, QT_VERSION_MINOR); diff --git a/src/render/renderers/opengl/graphicshelpers/graphicscontext.cpp b/src/render/renderers/opengl/graphicshelpers/graphicscontext.cpp index 1cd089903..01a1b107a 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicscontext.cpp +++ b/src/render/renderers/opengl/graphicshelpers/graphicscontext.cpp @@ -329,6 +329,11 @@ void GraphicsContext::activateDrawBuffers(const AttachmentPack &attachments) } } +void GraphicsContext::rasterMode(GLenum faceMode, GLenum rasterMode) +{ + m_glHelper->rasterMode(faceMode, rasterMode); +} + /*! * \internal * Finds the highest supported opengl version and internally use the most optimized diff --git a/src/render/renderers/opengl/graphicshelpers/graphicscontext_p.h b/src/render/renderers/opengl/graphicshelpers/graphicscontext_p.h index 934a400f6..548a6d9f4 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicscontext_p.h +++ b/src/render/renderers/opengl/graphicshelpers/graphicscontext_p.h @@ -167,6 +167,7 @@ public: void setVerticesPerPatch(GLint verticesPerPatch); void memoryBarrier(QMemoryBarrier::Operations barriers); void activateDrawBuffers(const AttachmentPack &attachments); + void rasterMode(GLenum faceMode, GLenum rasterMode); // Helper methods static GLint elementType(GLint type); diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelperes2.cpp b/src/render/renderers/opengl/graphicshelpers/graphicshelperes2.cpp index 382aecc4d..0eb7401ed 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelperes2.cpp +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelperes2.cpp @@ -345,6 +345,13 @@ void GraphicsHelperES2::deleteSync(void *) qWarning() << "Fences are not supported by OpenGL ES 2.0 (since OpenGL ES 3.0)"; } +void GraphicsHelperES2::rasterMode(GLenum faceMode, GLenum rasterMode) +{ + Q_UNUSED(faceMode); + Q_UNUSED(rasterMode); + qWarning() << "glPolyonMode is not supported with OpenGL ES"; +} + void GraphicsHelperES2::blendEquation(GLenum mode) { m_funcs->glBlendEquation(mode); diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelperes2_p.h b/src/render/renderers/opengl/graphicshelpers/graphicshelperes2_p.h index ace61edeb..87e4c92c8 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelperes2_p.h +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelperes2_p.h @@ -132,6 +132,7 @@ public: void vertexAttributePointer(GLenum shaderDataType, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) override; void readBuffer(GLenum mode) override; void drawBuffer(GLenum mode) override; + void rasterMode(GLenum faceMode, GLenum rasterMode) override; void *fenceSync() override; void clientWaitSync(void *sync, GLuint64 nanoSecTimeout) override; diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp index 6b7c3661e..d6dad7de2 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp @@ -299,6 +299,11 @@ void GraphicsHelperGL2::deleteSync(void *) qWarning() << "Fences are not supported by OpenGL 2.0 (since OpenGL 3.2)"; } +void GraphicsHelperGL2::rasterMode(GLenum faceMode, GLenum rasterMode) +{ + m_funcs->glPolygonMode(faceMode, rasterMode); +} + void GraphicsHelperGL2::blendEquation(GLenum mode) { m_funcs->glBlendEquation(mode); diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h index bf7e6e228..56e05e3ff 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h @@ -132,6 +132,7 @@ public: void vertexAttributePointer(GLenum shaderDataType, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) override; void readBuffer(GLenum mode) override; void drawBuffer(GLenum mode) override; + void rasterMode(GLenum faceMode, GLenum rasterMode) override; void *fenceSync() override; void clientWaitSync(void *sync, GLuint64 nanoSecTimeout) override; diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp index b0cb27556..9d5305059 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp @@ -365,6 +365,11 @@ void GraphicsHelperGL3_2::deleteSync(void *sync) m_funcs->glDeleteSync(static_cast<GLsync>(sync)); } +void GraphicsHelperGL3_2::rasterMode(GLenum faceMode, GLenum rasterMode) +{ + m_funcs->glPolygonMode(faceMode, rasterMode); +} + void GraphicsHelperGL3_2::blendEquation(GLenum mode) { m_funcs->glBlendEquation(mode); diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h index 065b61428..fc273a2c2 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h @@ -134,6 +134,7 @@ public: void vertexAttributePointer(GLenum shaderDataType, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) override; void readBuffer(GLenum mode) override; void drawBuffer(GLenum mode) override; + void rasterMode(GLenum faceMode, GLenum rasterMode) override; void *fenceSync() override; void clientWaitSync(void *sync, GLuint64 nanoSecTimeout) override; diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp index e8cb3ee95..6c636e292 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp @@ -361,6 +361,11 @@ void GraphicsHelperGL3_3::deleteSync(void *sync) m_funcs->glDeleteSync(static_cast<GLsync>(sync)); } +void GraphicsHelperGL3_3::rasterMode(GLenum faceMode, GLenum rasterMode) +{ + m_funcs->glPolygonMode(faceMode, rasterMode); +} + void GraphicsHelperGL3_3::blendEquation(GLenum mode) { m_funcs->glBlendEquation(mode); diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h index c7e5138d1..1750b66ee 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h @@ -134,6 +134,7 @@ public: void vertexAttributePointer(GLenum shaderDataType, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) override; void readBuffer(GLenum mode) override; void drawBuffer(GLenum mode) override; + void rasterMode(GLenum faceMode, GLenum rasterMode) override; void *fenceSync() override; void clientWaitSync(void *sync, GLuint64 nanoSecTimeout) override; diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp index c4f06c3eb..a8926860b 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp @@ -433,6 +433,11 @@ void GraphicsHelperGL4::deleteSync(void *sync) m_funcs->glDeleteSync(static_cast<GLsync>(sync)); } +void GraphicsHelperGL4::rasterMode(GLenum faceMode, GLenum rasterMode) +{ + m_funcs->glPolygonMode(faceMode, rasterMode); +} + void GraphicsHelperGL4::glUniform1fv(GLint location, GLsizei count, const GLfloat *values) { m_funcs->glUniform1fv(location, count, values); diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h index 878d6e309..26613a39a 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h @@ -132,6 +132,7 @@ public: void vertexAttributePointer(GLenum shaderDataType, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) override; void readBuffer(GLenum mode) override; void drawBuffer(GLenum mode) override; + void rasterMode(GLenum faceMode, GLenum rasterMode) override; void *fenceSync() override; void clientWaitSync(void *sync, GLuint64 nanoSecTimeout) override; diff --git a/src/render/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h b/src/render/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h index b50488823..d91761422 100644 --- a/src/render/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h +++ b/src/render/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h @@ -156,6 +156,7 @@ public: virtual void vertexAttributePointer(GLenum shaderDataType, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) = 0; virtual void readBuffer(GLenum mode) = 0; virtual void drawBuffer(GLenum mode) = 0; + virtual void rasterMode(GLenum faceMode, GLenum rasterMode) = 0; virtual void *fenceSync() = 0; virtual void clientWaitSync(void *sync, GLuint64 nanoSecTimeout) = 0; diff --git a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp index 4c264383b..a39b900e0 100644 --- a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp +++ b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp @@ -246,6 +246,11 @@ void applyStateHelper<DepthTest>(const DepthTest *state, SubmissionContext *gc) gc->depthTest(std::get<0>(state->values())); } +template<> +void applyStateHelper<RasterMode>(const RasterMode *state, SubmissionContext *gc) +{ + gc->rasterMode(std::get<0>(state->values()), std::get<1>(state->values())); +} template<> void applyStateHelper<NoDepthMask>(const NoDepthMask *state, SubmissionContext *gc) @@ -253,7 +258,6 @@ void applyStateHelper<NoDepthMask>(const NoDepthMask *state, SubmissionContext * gc->depthMask(std::get<0>(state->values())); } - template<> void applyStateHelper<CullFace>(const CullFace *state, SubmissionContext *gc) { @@ -1095,6 +1099,11 @@ void SubmissionContext::applyState(const StateVariant &stateVariant) break; } + case RasterModeMask: { + applyStateHelper<RasterMode>(static_cast<const RasterMode *>(stateVariant.constState()), this); + break; + } + case FrontFaceStateMask: { applyStateHelper<FrontFace>(static_cast<const FrontFace *>(stateVariant.constState()), this); break; @@ -1221,6 +1230,11 @@ void SubmissionContext::resetMasked(qint64 maskOfStatesToReset) if (maskOfStatesToReset & LineWidthMask) funcs->glLineWidth(1.0f); + +#ifndef QT_OPENGL_ES_2 + if (maskOfStatesToReset & RasterModeMask) + m_glHelper->rasterMode(GL_FRONT_AND_BACK, GL_FILL); +#endif } void SubmissionContext::applyStateSet(RenderStateSet *ss) diff --git a/src/render/renderstates/qrastermode.cpp b/src/render/renderstates/qrastermode.cpp new file mode 100644 index 000000000..065a1ca8c --- /dev/null +++ b/src/render/renderstates/qrastermode.cpp @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qrastermode.h" +#include "qrastermode_p.h" +#include <Qt3DRender/private/qrenderstatecreatedchange_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { + +QRasterMode::QRasterMode(QNode *parent) + : QRenderState(*new QRasterModePrivate, parent) +{ +} + +QRasterMode::RasterMode QRasterMode::rasterMode() const +{ + Q_D(const QRasterMode); + return d->m_rasterMode; +} + +QRasterMode::FaceMode QRasterMode::faceMode() const +{ + Q_D(const QRasterMode); + return d->m_faceMode; +} + +void QRasterMode::setRasterMode(QRasterMode::RasterMode rasterMode) +{ + Q_D(QRasterMode); + if (d->m_rasterMode != rasterMode) { + d->m_rasterMode = rasterMode; + emit rasterModeChanged(rasterMode); + } +} + +void QRasterMode::setFaceMode(QRasterMode::FaceMode faceMode) +{ + Q_D(QRasterMode); + if (d->m_faceMode != faceMode) { + d->m_faceMode = faceMode; + emit faceModeChanged(faceMode); + } +} + +Qt3DCore::QNodeCreatedChangeBasePtr QRasterMode::createNodeCreationChange() const +{ + auto creationChange = QRenderStateCreatedChangePtr<QRasterModeData>::create(this); + auto &data = creationChange->data; + Q_D(const QRasterMode); + data.rasterMode = d->m_rasterMode; + data.faceMode = d->m_faceMode; + return creationChange; +} + +} // namespace Qt3DRender + +QT_END_NAMESPACE diff --git a/src/render/renderstates/qrastermode.h b/src/render/renderstates/qrastermode.h new file mode 100644 index 000000000..9448a6932 --- /dev/null +++ b/src/render/renderstates/qrastermode.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DRENDER_QRASTERMODE_H +#define QT3DRENDER_QRASTERMODE_H + +#include <Qt3DRender/qrenderstate.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { + +class QRasterModePrivate; + +class QT3DRENDERSHARED_EXPORT QRasterMode : public QRenderState +{ + Q_OBJECT + Q_PROPERTY(RasterMode rasterMode READ rasterMode WRITE setRasterMode NOTIFY rasterModeChanged) + Q_PROPERTY(FaceMode faceMode READ faceMode WRITE setFaceMode NOTIFY faceModeChanged) +public: + + enum RasterMode { + Points = 0x1B00, + Lines = 0x1B01, + Fill = 0x1B02, + }; + Q_ENUM(RasterMode) // LCOV_EXCL_LINE + + enum FaceMode + { + Front = 0x0404, + Back = 0x0405, + FrontAndBack = 0x0408 + }; + Q_ENUM(FaceMode) // LCOV_EXCL_LINE + + explicit QRasterMode(Qt3DCore::QNode *parent = nullptr); + ~QRasterMode() = default; + + RasterMode rasterMode() const; + FaceMode faceMode() const; + +public Q_SLOTS: + void setRasterMode(RasterMode rasterMode); + void setFaceMode(FaceMode faceMode); + +Q_SIGNALS: + void rasterModeChanged(RasterMode rasterMode); + void faceModeChanged(FaceMode faceMode); + +private: + Q_DECLARE_PRIVATE(QRasterMode) + Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const override; +}; + +} // namespace Qt3DRender + +QT_END_NAMESPACE + +#endif // QT3DRENDER_QRASTERMODE_H diff --git a/src/render/renderstates/qrastermode_p.h b/src/render/renderstates/qrastermode_p.h new file mode 100644 index 000000000..506689f02 --- /dev/null +++ b/src/render/renderstates/qrastermode_p.h @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DRENDER_QRASTERMODE_P_H +#define QT3DRENDER_QRASTERMODE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of other Qt classes. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <Qt3DRender/private/qrenderstate_p.h> +#include <Qt3DRender/qrastermode.h> +#include <Qt3DRender/private/qt3drender_global_p.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { + +class QT3DRENDERSHARED_PRIVATE_EXPORT QRasterModePrivate : public QRenderStatePrivate +{ +public : + QRasterModePrivate() + : QRenderStatePrivate(Render::RasterModeMask) + , m_rasterMode(QRasterMode::Fill) + , m_faceMode(QRasterMode::FrontAndBack) + { + } + + Q_DECLARE_PUBLIC(QRasterMode) + QRasterMode::RasterMode m_rasterMode; + QRasterMode::FaceMode m_faceMode; +}; + +struct QRasterModeData +{ + QRasterMode::FaceMode faceMode; + QRasterMode::RasterMode rasterMode; +}; + +} // namespace Qt3DRender + +QT_END_NAMESPACE + +#endif // QT3DRENDER_QRASTERMODE_P_H diff --git a/src/render/renderstates/renderstatenode.cpp b/src/render/renderstates/renderstatenode.cpp index 1cab44218..f83640154 100644 --- a/src/render/renderstates/renderstatenode.cpp +++ b/src/render/renderstates/renderstatenode.cpp @@ -55,6 +55,8 @@ #include <Qt3DRender/private/qdepthrange_p.h> #include <Qt3DRender/qdepthtest.h> #include <Qt3DRender/private/qdepthtest_p.h> +#include <Qt3DRender/qrastermode.h> +#include <Qt3DRender/private/qrastermode_p.h> #include <Qt3DRender/qdithering.h> #include <Qt3DRender/qfrontface.h> #include <Qt3DRender/private/qfrontface_p.h> @@ -144,6 +146,12 @@ StateVariant createStateImplementation(const Qt3DRender::QRenderStateCreatedChan return StateVariant::createState<DepthTest>(data.depthFunction); } + case RasterModeMask: { + const auto typedChange = qSharedPointerCast<Qt3DRender::QRenderStateCreatedChange<QRasterModeData>>(renderStateChange); + const auto &data = typedChange->data; + return StateVariant::createState<RasterMode>(data.faceMode, data.rasterMode); + } + case FrontFaceStateMask: { const auto typedChange = qSharedPointerCast<Qt3DRender::QRenderStateCreatedChange<QFrontFaceData>>(renderStateChange); const auto &data = typedChange->data; diff --git a/src/render/renderstates/renderstates.cpp b/src/render/renderstates/renderstates.cpp index c954d9d2c..77143ecd3 100644 --- a/src/render/renderstates/renderstates.cpp +++ b/src/render/renderstates/renderstates.cpp @@ -100,6 +100,12 @@ void DepthTest::updateProperty(const char *name, const QVariant &value) if (name == QByteArrayLiteral("depthFunction")) std::get<0>(m_values) = value.toInt(); } +void RasterMode::updateProperty(const char *name, const QVariant &value) +{ + if (name == QByteArrayLiteral("rasterMode")) std::get<0>(m_values) = value.toInt(); + if (name == QByteArrayLiteral("faceMode")) std::get<1>(m_values) = value.toInt(); +} + void CullFace::updateProperty(const char *name, const QVariant &value) { if (name == QByteArrayLiteral("mode")) std::get<0>(m_values) = value.toInt(); diff --git a/src/render/renderstates/renderstates.pri b/src/render/renderstates/renderstates.pri index b084a8759..06ba53a41 100644 --- a/src/render/renderstates/renderstates.pri +++ b/src/render/renderstates/renderstates.pri @@ -49,7 +49,9 @@ HEADERS += \ $$PWD/renderstatenode_p.h \ $$PWD/qmultisampleantialiasing.h \ $$PWD/statemask_p.h \ - $$PWD/statevariant_p.h + $$PWD/statevariant_p.h \ + $$PWD/qrastermode.h \ + $$PWD/qrastermode_p.h SOURCES += \ $$PWD/qalphacoverage.cpp \ @@ -79,4 +81,5 @@ SOURCES += \ $$PWD/qrenderstatecreatedchange.cpp \ $$PWD/renderstatenode.cpp \ $$PWD/statevariant.cpp \ - $$PWD/qmultisampleantialiasing.cpp + $$PWD/qmultisampleantialiasing.cpp \ + $$PWD/qrastermode.cpp diff --git a/src/render/renderstates/renderstates_p.h b/src/render/renderstates/renderstates_p.h index e769be2a4..7c6dc4ebd 100644 --- a/src/render/renderstates/renderstates_p.h +++ b/src/render/renderstates/renderstates_p.h @@ -95,6 +95,12 @@ public: void updateProperty(const char *name, const QVariant &value) override; }; +class Q_AUTOTEST_EXPORT RasterMode : public GenericState<RasterMode, RasterModeMask, GLenum, GLenum> +{ +public: + void updateProperty(const char *name, const QVariant &value) override; +}; + class Q_AUTOTEST_EXPORT NoDepthMask : public GenericState<NoDepthMask, DepthWriteStateMask, GLboolean> { public: diff --git a/src/render/renderstates/statemask_p.h b/src/render/renderstates/statemask_p.h index 6920a7d5b..ca64e30cd 100644 --- a/src/render/renderstates/statemask_p.h +++ b/src/render/renderstates/statemask_p.h @@ -82,6 +82,7 @@ enum StateMask BlendEquationArgumentsMask = 1 << 18, LineWidthMask = 1 << 19, DepthRangeMask = 1 << 20, + RasterModeMask = 1 << 21 }; } // namespace Render diff --git a/src/render/renderstates/statevariant.cpp b/src/render/renderstates/statevariant.cpp index 09c800470..47b3fd0a7 100644 --- a/src/render/renderstates/statevariant.cpp +++ b/src/render/renderstates/statevariant.cpp @@ -68,6 +68,7 @@ RenderStateImpl *StateVariant::state() case StencilOpMask: case StencilWriteStateMask: case LineWidthMask: + case RasterModeMask: return &data.blendEquationArguments; default: Q_UNREACHABLE(); @@ -98,6 +99,7 @@ const RenderStateImpl *StateVariant::constState() const case StencilOpMask: case StencilWriteStateMask: case LineWidthMask: + case RasterModeMask: return &data.blendEquationArguments; default: Q_UNREACHABLE(); diff --git a/tests/auto/render/graphicshelpergl2/tst_graphicshelpergl2.cpp b/tests/auto/render/graphicshelpergl2/tst_graphicshelpergl2.cpp index 6c756957f..ffafc2312 100644 --- a/tests/auto/render/graphicshelpergl2/tst_graphicshelpergl2.cpp +++ b/tests/auto/render/graphicshelpergl2/tst_graphicshelpergl2.cpp @@ -1557,6 +1557,24 @@ private Q_SLOTS: // Not supported by GL2 } + void rasterMode() + { + if (!m_initializationSuccessful) + QSKIP("Initialization failed, OpenGL 2.0 functions not supported"); + + m_func->glGetError(); + + // WHEN + m_glHelper.rasterMode(GL_FRONT_AND_BACK, GL_LINE); + + // THEN + const GLint error = m_func->glGetError(); + QVERIFY(error == 0); + GLint p; + m_func->glGetIntegerv(GL_POLYGON_MODE, &p); + QCOMPARE(p, GL_LINE); + } + private: QScopedPointer<QWindow> m_window; QOpenGLContext m_glContext; diff --git a/tests/auto/render/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp b/tests/auto/render/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp index 5eb171827..840a7f6da 100644 --- a/tests/auto/render/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp +++ b/tests/auto/render/graphicshelpergl3_2/tst_graphicshelpergl3_2.cpp @@ -2250,6 +2250,23 @@ private Q_SLOTS: QCOMPARE(m_func->glIsSync(sync), GL_FALSE); } + void rasterMode() + { + if (!m_initializationSuccessful) + QSKIP("Initialization failed, OpenGL 3.2 functions not supported"); + + m_func->glGetError(); + + m_glHelper.rasterMode(GL_FRONT_AND_BACK, GL_LINE); + + // THEN + const GLint error = m_func->glGetError(); + QVERIFY(error == 0); + GLint p; + m_func->glGetIntegerv(GL_POLYGON_MODE, &p); + QCOMPARE(p, GL_LINE); + } + private: QScopedPointer<QWindow> m_window; QOpenGLContext m_glContext; diff --git a/tests/auto/render/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp b/tests/auto/render/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp index a88e36d5e..874c83f0b 100644 --- a/tests/auto/render/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp +++ b/tests/auto/render/graphicshelpergl3_3/tst_graphicshelpergl3_3.cpp @@ -2350,6 +2350,22 @@ private Q_SLOTS: QCOMPARE(m_func->glIsSync(sync), GL_FALSE); } + void rasterMode() + { + if (!m_initializationSuccessful) + QSKIP("Initialization failed, OpenGL 3.3 functions not supported"); + + m_func->glGetError(); + m_glHelper.rasterMode(GL_FRONT_AND_BACK, GL_LINE); + + // THEN + const GLint error = m_func->glGetError(); + QVERIFY(error == 0); + GLint p; + m_func->glGetIntegerv(GL_POLYGON_MODE, &p); + QCOMPARE(p, GL_LINE); + } + private: QScopedPointer<QWindow> m_window; QOpenGLContext m_glContext; diff --git a/tests/auto/render/graphicshelpergl4/tst_graphicshelpergl4.cpp b/tests/auto/render/graphicshelpergl4/tst_graphicshelpergl4.cpp index 87eee19ac..a1d1b8ff3 100644 --- a/tests/auto/render/graphicshelpergl4/tst_graphicshelpergl4.cpp +++ b/tests/auto/render/graphicshelpergl4/tst_graphicshelpergl4.cpp @@ -2448,6 +2448,22 @@ private Q_SLOTS: QCOMPARE(m_func->glIsSync(sync), GL_FALSE); } + void rasterMode() + { + if (!m_initializationSuccessful) + QSKIP("Initialization failed, OpenGL 4.3 functions not supported"); + + m_func->glGetError(); + m_glHelper.rasterMode(GL_FRONT_AND_BACK, GL_LINE); + + // THEN + const GLint error = m_func->glGetError(); + QVERIFY(error == 0); + GLint p; + m_func->glGetIntegerv(GL_POLYGON_MODE, &p); + QCOMPARE(p, GL_LINE); + } + private: QScopedPointer<QWindow> m_window; QOpenGLContext m_glContext; diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index 585928237..c74d51c57 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -59,7 +59,9 @@ SUBDIRS += \ blitframebuffer-qml \ raycasting-qml \ shared_texture_image \ - texture_property_updates + texture_property_updates \ + raster-cpp \ + raster-qml qtHaveModule(multimedia): { SUBDIRS += \ diff --git a/tests/manual/raster-cpp/main.cpp b/tests/manual/raster-cpp/main.cpp new file mode 100644 index 000000000..2eaeea6ec --- /dev/null +++ b/tests/manual/raster-cpp/main.cpp @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QGuiApplication> + +#include <Qt3DInput/QInputAspect> + +#include <Qt3DRender/qcamera.h> +#include <Qt3DRender/qcameralens.h> +#include <Qt3DExtras/qcylindermesh.h> +#include <Qt3DRender/qmesh.h> +#include <Qt3DRender/qtechnique.h> +#include <Qt3DExtras/qphongmaterial.h> +#include <Qt3DRender/qeffect.h> +#include <Qt3DRender/qtexture.h> +#include <Qt3DRender/qrenderpass.h> +#include <Qt3DRender/qrenderaspect.h> +#include <Qt3DExtras/qforwardrenderer.h> + +#include <Qt3DCore/qentity.h> +#include <Qt3DCore/qtransform.h> +#include <Qt3DCore/qaspectengine.h> + +#include <Qt3DRender/QRenderStateSet> +#include <Qt3DRender/QRasterMode> + +#include <Qt3DExtras/qt3dwindow.h> +#include <Qt3DExtras/qorbitcameracontroller.h> + +int main(int argc, char **argv) +{ + QGuiApplication app(argc, argv); + Qt3DExtras::Qt3DWindow view; + + // Add a raster mode + Qt3DRender::QRenderStateSet *renderStateSet = new Qt3DRender::QRenderStateSet(); + view.activeFrameGraph()->setParent(renderStateSet); + Qt3DRender::QRasterMode *rasterModeRenderState = new Qt3DRender::QRasterMode(renderStateSet); + rasterModeRenderState->setRasterMode(Qt3DRender::QRasterMode::RasterMode::Lines); + renderStateSet->addRenderState(rasterModeRenderState); + view.setActiveFrameGraph(renderStateSet); + + // Root entity + Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity(); + + // Camera + Qt3DRender::QCamera *camera = view.camera(); + camera->lens()->setPerspectiveProjection(45.0f, 16.0f/9.0f, 0.1f, 1000.0f); + camera->setPosition(QVector3D(0, 0, 20.0f)); + camera->setUpVector(QVector3D(0, 1, 0)); + camera->setViewCenter(QVector3D(0, 0, 0)); + + // For camera controls + Qt3DExtras::QOrbitCameraController *cameraController = new Qt3DExtras::QOrbitCameraController(rootEntity); + cameraController->setCamera(camera); + + // Cylinder shape data + Qt3DExtras::QCylinderMesh *mesh = new Qt3DExtras::QCylinderMesh(); + mesh->setRadius(1); + mesh->setLength(3); + mesh->setRings(100); + mesh->setSlices(20); + + // Transform for cylinder + Qt3DCore::QTransform *transform = new Qt3DCore::QTransform; + transform->setScale(1.5f); + transform->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(1, 0, 0), 45.0f)); + + // Material + Qt3DExtras::QPhongMaterial *material = new Qt3DExtras::QPhongMaterial(rootEntity); + material->setDiffuse(Qt::red); + + // Cylinder + Qt3DCore::QEntity *cylinder = new Qt3DCore::QEntity(rootEntity); + cylinder->addComponent(mesh); + cylinder->addComponent(transform); + cylinder->addComponent(material); + + // Set root object of the scene + view.setRootEntity(rootEntity); + view.show(); + + return app.exec(); +} diff --git a/tests/manual/raster-cpp/raster-cpp.pro b/tests/manual/raster-cpp/raster-cpp.pro new file mode 100644 index 000000000..d3db3bc76 --- /dev/null +++ b/tests/manual/raster-cpp/raster-cpp.pro @@ -0,0 +1,9 @@ +!include( ../manual.pri ) { + error( "Couldn't find the manual.pri file!" ) +} + +QT += 3dcore 3drender 3dinput 3dextras + +SOURCES += main.cpp + + diff --git a/tests/manual/raster-qml/main.cpp b/tests/manual/raster-qml/main.cpp new file mode 100644 index 000000000..3741265c7 --- /dev/null +++ b/tests/manual/raster-qml/main.cpp @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <Qt3DQuickExtras/qt3dquickwindow.h> +#include <QGuiApplication> + +int main(int argc, char* argv[]) +{ + QGuiApplication app(argc, argv); + Qt3DExtras::Quick::Qt3DQuickWindow view; + + view.setSource(QUrl("qrc:/main.qml")); + view.show(); + + return app.exec(); +} diff --git a/tests/manual/raster-qml/main.qml b/tests/manual/raster-qml/main.qml new file mode 100644 index 000000000..91fc288d0 --- /dev/null +++ b/tests/manual/raster-qml/main.qml @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt3D.Core 2.0 +import Qt3D.Render 2.13 +import Qt3D.Input 2.0 +import Qt3D.Extras 2.0 + +Entity { + id: sceneRoot + + Camera { + id: camera + projectionType: CameraLens.PerspectiveProjection + fieldOfView: 45 + aspectRatio: 16/9 + nearPlane : 0.1 + farPlane : 1000.0 + position: Qt.vector3d( 0.0, 0.0, 20.0 ) + upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) + viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 ) + } + + OrbitCameraController { camera: camera } + + RenderSettings { + id : external_forward_renderer + activeFrameGraph : RenderStateSet { + renderStates: [ + RasterMode { + rasterMode: RasterMode.Lines + } + ] + ForwardRenderer { + camera: camera + clearColor: "black" + } + } + } + + // Event Source will be set by the Qt3DQuickWindow + InputSettings { id: inputSettings } + + components: [external_forward_renderer, inputSettings] + + CylinderMesh { + id: mesh + radius: 1 + length: 3 + rings: 100 + slices: 20 + } + + Transform { + id: transform + scale: 1.5 + rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 45) + } + + PhongMaterial { + id: material + diffuse: "green" + } + + Entity { + id: mainEntity + objectName: "mainEntity" + components: [ mesh, material, transform ] + } +} diff --git a/tests/manual/raster-qml/raster-qml.pro b/tests/manual/raster-qml/raster-qml.pro new file mode 100644 index 000000000..a3d377ca3 --- /dev/null +++ b/tests/manual/raster-qml/raster-qml.pro @@ -0,0 +1,14 @@ +!include( ../manual.pri ) { + error( "Couldn't find the manual.pri file!" ) +} + +QT += 3dcore 3drender 3dinput 3dquick qml quick 3dquickextras + +SOURCES += \ + main.cpp + +OTHER_FILES += \ + main.qml + +RESOURCES += \ + raster-qml.qrc diff --git a/tests/manual/raster-qml/raster-qml.qrc b/tests/manual/raster-qml/raster-qml.qrc new file mode 100644 index 000000000..5f6483ac3 --- /dev/null +++ b/tests/manual/raster-qml/raster-qml.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + </qresource> +</RCC> |