summaryrefslogtreecommitdiffstats
path: root/src/render/renderstates/qblendstate.h
diff options
context:
space:
mode:
authorWieland Hagen <wieland.hagen@kdab.com>2016-01-14 18:18:35 +0100
committerWieland Hagen <wieland.hagen@kdab.com>2016-01-15 13:02:47 +0000
commit4a93090a7b51da4a1e9f66d9727003fac0df53ac (patch)
treef0584b66f9b83ff2ed80fec174146d4c491eac63 /src/render/renderstates/qblendstate.h
parent0f50b649912d44eb75e37a3f17afcefbec40fba7 (diff)
QBlendState: Target particular Draw Buffers (glBlendFunci())
There are 3 ways blending can be configured, depending on GL version: pre-3.0: Globally 3.0-3.3: Individual GL_BLEND for each Draw Buffer, one glBlendFunc 4.0- : Individual GL_BLEND and glBlendFunci for each DrawBuffer QBlendStates now allow to specify whether the blend state should be enabled or not, and what Draw Buffer it is specifying. Defaults are global and enabled. Removed backend BlendStateSeparate, BlendState is going to handle both calls. Task-number: QTBUG-50005 Change-Id: I0059a53db0d629ef9818d933c3f14e5662c1d3df Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/renderstates/qblendstate.h')
-rw-r--r--src/render/renderstates/qblendstate.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/render/renderstates/qblendstate.h b/src/render/renderstates/qblendstate.h
index 5d9d53787..bacb5eed5 100644
--- a/src/render/renderstates/qblendstate.h
+++ b/src/render/renderstates/qblendstate.h
@@ -53,6 +53,9 @@ class QT3DRENDERSHARED_EXPORT QBlendState : public QRenderState
Q_PROPERTY(Blending srcAlpha READ srcAlpha WRITE setSrcAlpha NOTIFY srcAlphaChanged)
Q_PROPERTY(Blending dstRGB READ dstRGB WRITE setDstRGB NOTIFY dstRGBChanged)
Q_PROPERTY(Blending dstAlpha READ dstAlpha WRITE setDstAlpha NOTIFY dstAlphaChanged)
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(bool specifiesAllDrawBuffers READ specifiesAllDrawBuffers NOTIFY specifiesAllDrawBuffersChanged)
+ Q_PROPERTY(int bufferIndex READ bufferIndex WRITE setBufferIndex NOTIFY bufferIndexChanged)
public:
@@ -87,18 +90,26 @@ public:
Blending dstRGB() const;
Blending srcAlpha() const;
Blending dstAlpha() const;
+ bool enabled() const;
+ int bufferIndex() const;
+ bool specifiesAllDrawBuffers() const;
public Q_SLOTS:
void setSrcRGB(Blending srcRGB);
void setDstRGB(Blending dstRGB);
void setSrcAlpha(Blending srcAlpha);
void setDstAlpha(Blending dstAlpha);
+ void setEnabled(bool isEnabled);
+ void setBufferIndex(int index);
Q_SIGNALS:
void srcRGBChanged(Blending srcRGB);
void srcAlphaChanged(Blending srcAlpha);
void dstRGBChanged(Blending dstRGB);
void dstAlphaChanged(Blending dstAlpha);
+ void enabledChanged(bool enabled);
+ void bufferIndexChanged(int index);
+ void specifiesAllDrawBuffersChanged(bool specifyAll);
protected:
void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE;