diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-01-17 10:09:57 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-01-17 17:19:54 +0000 |
commit | 8be639496d435e782eb734a46fbbb2d2e058eb7c (patch) | |
tree | 8e6c20de5b885276d75585c2f329276dc788f37f /src/render | |
parent | bbc276e861e49cad0400c94bf7930a85254cbf56 (diff) |
Fix annotations in QPhongAlphaMaterial default
Change-Id: Ie96e1276dad51536d42d7d01c59885a82431a033
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/defaults/qphongalphamaterial.cpp | 13 | ||||
-rw-r--r-- | src/render/defaults/qphongalphamaterial_p.h | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/render/defaults/qphongalphamaterial.cpp b/src/render/defaults/qphongalphamaterial.cpp index 494c77e1b..01a952319 100644 --- a/src/render/defaults/qphongalphamaterial.cpp +++ b/src/render/defaults/qphongalphamaterial.cpp @@ -36,6 +36,7 @@ #include "qphongalphamaterial.h" #include "qphongalphamaterial_p.h" +#include <Qt3DRender/qannotation.h> #include <Qt3DRender/qmaterial.h> #include <Qt3DRender/qeffect.h> #include <Qt3DRender/qtechnique.h> @@ -77,6 +78,7 @@ QPhongAlphaMaterialPrivate::QPhongAlphaMaterialPrivate() , m_depthMask(new QDepthMask()) , m_blendState(new QBlendState()) , m_blendEquation(new QBlendEquation()) + , m_annotation(new QAnnotation) { } @@ -114,6 +116,15 @@ void QPhongAlphaMaterialPrivate::init() m_phongAlphaES2Technique->graphicsApiFilter()->setMinorVersion(0); m_phongAlphaES2Technique->graphicsApiFilter()->setProfile(QGraphicsApiFilter::NoProfile); + Q_Q(QPhongAlphaMaterial); + m_annotation->setParent(q); + m_annotation->setName(QStringLiteral("renderingStyle")); + m_annotation->setValue("forward"); + + m_phongAlphaGL3Technique->addAnnotation(m_annotation); + m_phongAlphaGL2Technique->addAnnotation(m_annotation); + m_phongAlphaES2Technique->addAnnotation(m_annotation); + m_depthMask->setMask(false); m_blendState->setSrcRGB(QBlendState::SrcAlpha); m_blendState->setDstRGB(QBlendState::OneMinusSrcAlpha); @@ -149,7 +160,7 @@ void QPhongAlphaMaterialPrivate::init() m_phongEffect->addParameter(m_shininessParameter); m_phongEffect->addParameter(m_alphaParameter); - q_func()->setEffect(m_phongEffect); + q->setEffect(m_phongEffect); } void QPhongAlphaMaterialPrivate::handleAmbientChanged(const QVariant &var) diff --git a/src/render/defaults/qphongalphamaterial_p.h b/src/render/defaults/qphongalphamaterial_p.h index 10c9092b1..8396b50a7 100644 --- a/src/render/defaults/qphongalphamaterial_p.h +++ b/src/render/defaults/qphongalphamaterial_p.h @@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE namespace Qt3DRender { +class QAnnotation; class QEffect; class QTechnique; class QParameter; @@ -96,6 +97,7 @@ public: QDepthMask *m_depthMask; QBlendState *m_blendState; QBlendEquation *m_blendEquation; + QAnnotation *m_annotation; Q_DECLARE_PUBLIC(QPhongAlphaMaterial) }; |