summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWieland Hagen <wieland.hagen@kdab.com>2016-01-07 16:42:27 +0100
committerWieland Hagen <wieland.hagen@kdab.com>2016-01-07 18:13:07 +0000
commit0bd3027f0f81321ce04e9d255cb2a0358d1c83ad (patch)
tree5302cd95d0f3877b50ab75db1180347584f18b45
parent8470782d4ecb56aaddc983d349f87870b46affc4 (diff)
Add glBlendFunci() to GraphicsContext + GraphicsHelper
Only for OpenGL 4.0. Task-number: QTBUG-50005 Change-Id: I70984a2bff3afc04539efa7dea60196aa06e72d2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/graphicshelpers/graphicscontext.cpp5
-rw-r--r--src/render/graphicshelpers/graphicscontext_p.h1
-rw-r--r--src/render/graphicshelpers/graphicshelperes2.cpp9
-rw-r--r--src/render/graphicshelpers/graphicshelperes2_p.h1
-rw-r--r--src/render/graphicshelpers/graphicshelpergl2.cpp9
-rw-r--r--src/render/graphicshelpers/graphicshelpergl2_p.h1
-rw-r--r--src/render/graphicshelpers/graphicshelpergl3.cpp9
-rw-r--r--src/render/graphicshelpers/graphicshelpergl3_3.cpp9
-rw-r--r--src/render/graphicshelpers/graphicshelpergl3_3_p.h1
-rw-r--r--src/render/graphicshelpers/graphicshelpergl3_p.h1
-rw-r--r--src/render/graphicshelpers/graphicshelpergl4.cpp5
-rw-r--r--src/render/graphicshelpers/graphicshelpergl4_p.h1
-rw-r--r--src/render/graphicshelpers/graphicshelperinterface_p.h1
13 files changed, 53 insertions, 0 deletions
diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp
index 92f5abbf4..e94611010 100644
--- a/src/render/graphicshelpers/graphicscontext.cpp
+++ b/src/render/graphicshelpers/graphicscontext.cpp
@@ -687,6 +687,11 @@ void GraphicsContext::blendEquation(GLenum mode)
m_glHelper->blendEquation(mode);
}
+void GraphicsContext::blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
+{
+ m_glHelper->blendFunci(buf, sfactor, dfactor);
+}
+
void GraphicsContext::alphaTest(GLenum mode1, GLenum mode2)
{
m_glHelper->alphaTest(mode1, mode2);
diff --git a/src/render/graphicshelpers/graphicscontext_p.h b/src/render/graphicshelpers/graphicscontext_p.h
index 78b134e68..c377d237b 100644
--- a/src/render/graphicshelpers/graphicscontext_p.h
+++ b/src/render/graphicshelpers/graphicscontext_p.h
@@ -175,6 +175,7 @@ public:
void bindUniformBlock(GLuint programId, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
void bindUniform(const QVariant &v, const ShaderUniform &description);
void blendEquation(GLenum mode);
+ void blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor);
GLuint boundFrameBufferObject();
void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer);
void clearColor(const QColor &color);
diff --git a/src/render/graphicshelpers/graphicshelperes2.cpp b/src/render/graphicshelpers/graphicshelperes2.cpp
index 2072df3f4..86e526d61 100644
--- a/src/render/graphicshelpers/graphicshelperes2.cpp
+++ b/src/render/graphicshelpers/graphicshelperes2.cpp
@@ -219,6 +219,15 @@ void GraphicsHelperES2::blendEquation(GLenum mode)
m_funcs->glBlendEquation(mode);
}
+void GraphicsHelperES2::blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
+{
+ Q_UNUSED(buf);
+ Q_UNUSED(sfactor);
+ Q_UNUSED(dfactor);
+
+ qWarning() << "glBlendFunci() not supported by OpenGL ES 2.0";
+}
+
void GraphicsHelperES2::alphaTest(GLenum, GLenum)
{
qCWarning(Render::Rendering) << Q_FUNC_INFO << "AlphaTest not available with OpenGL ES 2.0";
diff --git a/src/render/graphicshelpers/graphicshelperes2_p.h b/src/render/graphicshelpers/graphicshelperes2_p.h
index 8686d678c..5d75137e9 100644
--- a/src/render/graphicshelpers/graphicshelperes2_p.h
+++ b/src/render/graphicshelpers/graphicshelperes2_p.h
@@ -72,6 +72,7 @@ public:
void bindUniformBlock(GLuint programId, GLuint uniformBlockIndex, GLuint uniformBlockBinding) Q_DECL_OVERRIDE;
void bindUniform(const QVariant &v, const ShaderUniform &description) Q_DECL_OVERRIDE;
void blendEquation(GLenum mode) Q_DECL_OVERRIDE;
+ void blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor) Q_DECL_OVERRIDE;
GLuint boundFrameBufferObject() Q_DECL_OVERRIDE;
void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer) Q_DECL_OVERRIDE;
bool checkFrameBufferComplete() Q_DECL_OVERRIDE;
diff --git a/src/render/graphicshelpers/graphicshelpergl2.cpp b/src/render/graphicshelpers/graphicshelpergl2.cpp
index c21a6eeba..a73833b28 100644
--- a/src/render/graphicshelpers/graphicshelpergl2.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl2.cpp
@@ -202,6 +202,15 @@ void GraphicsHelperGL2::blendEquation(GLenum mode)
m_funcs->glBlendEquation(mode);
}
+void GraphicsHelperGL2::blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
+{
+ Q_UNUSED(buf);
+ Q_UNUSED(sfactor);
+ Q_UNUSED(dfactor);
+
+ qWarning() << "glBlendFunci() not supported by OpenGL 2.0 (since OpenGL 4.0)";
+}
+
void GraphicsHelperGL2::alphaTest(GLenum mode1, GLenum mode2)
{
m_funcs->glEnable(GL_ALPHA_TEST);
diff --git a/src/render/graphicshelpers/graphicshelpergl2_p.h b/src/render/graphicshelpers/graphicshelpergl2_p.h
index 3ad81bb02..62016c9e8 100644
--- a/src/render/graphicshelpers/graphicshelpergl2_p.h
+++ b/src/render/graphicshelpers/graphicshelpergl2_p.h
@@ -74,6 +74,7 @@ public:
void bindUniformBlock(GLuint programId, GLuint uniformBlockIndex, GLuint uniformBlockBinding) Q_DECL_OVERRIDE;
void bindUniform(const QVariant &v, const ShaderUniform &description) Q_DECL_OVERRIDE;
void blendEquation(GLenum mode) Q_DECL_OVERRIDE;
+ void blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor) Q_DECL_OVERRIDE;
GLuint boundFrameBufferObject() Q_DECL_OVERRIDE;
void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer) Q_DECL_OVERRIDE;
bool checkFrameBufferComplete() Q_DECL_OVERRIDE;
diff --git a/src/render/graphicshelpers/graphicshelpergl3.cpp b/src/render/graphicshelpers/graphicshelpergl3.cpp
index 0f48348e4..181093cbc 100644
--- a/src/render/graphicshelpers/graphicshelpergl3.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl3.cpp
@@ -230,6 +230,15 @@ void GraphicsHelperGL3::blendEquation(GLenum mode)
m_funcs->glBlendEquation(mode);
}
+void GraphicsHelperGL3::blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
+{
+ Q_UNUSED(buf);
+ Q_UNUSED(sfactor);
+ Q_UNUSED(dfactor);
+
+ qWarning() << "glBlendFunci() not supported by OpenGL 3.0 (since OpenGL 4.0)";
+}
+
void GraphicsHelperGL3::alphaTest(GLenum, GLenum)
{
qCWarning(Render::Rendering) << "AlphaTest not available with OpenGL 3.2 core";
diff --git a/src/render/graphicshelpers/graphicshelpergl3_3.cpp b/src/render/graphicshelpers/graphicshelpergl3_3.cpp
index 3cc06482f..e5e7c23e1 100644
--- a/src/render/graphicshelpers/graphicshelpergl3_3.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl3_3.cpp
@@ -227,6 +227,15 @@ void GraphicsHelperGL3_3::blendEquation(GLenum mode)
m_funcs->glBlendEquation(mode);
}
+void GraphicsHelperGL3_3::blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
+{
+ Q_UNUSED(buf);
+ Q_UNUSED(sfactor);
+ Q_UNUSED(dfactor);
+
+ qWarning() << "glBlendFunci() not supported by OpenGL 3.3 (since OpenGL 4.0)";
+}
+
void GraphicsHelperGL3_3::alphaTest(GLenum, GLenum)
{
qCWarning(Render::Rendering) << "AlphaTest not available with OpenGL 3.2 core";
diff --git a/src/render/graphicshelpers/graphicshelpergl3_3_p.h b/src/render/graphicshelpers/graphicshelpergl3_3_p.h
index a363a7b61..625720d06 100644
--- a/src/render/graphicshelpers/graphicshelpergl3_3_p.h
+++ b/src/render/graphicshelpers/graphicshelpergl3_3_p.h
@@ -75,6 +75,7 @@ public:
void bindUniformBlock(GLuint programId, GLuint uniformBlockIndex, GLuint uniformBlockBinding) Q_DECL_OVERRIDE;
void bindUniform(const QVariant &v, const ShaderUniform &description) Q_DECL_OVERRIDE;
void blendEquation(GLenum mode) Q_DECL_OVERRIDE;
+ void blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor) Q_DECL_OVERRIDE;
GLuint boundFrameBufferObject() Q_DECL_OVERRIDE;
void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer) Q_DECL_OVERRIDE;
bool checkFrameBufferComplete() Q_DECL_OVERRIDE;
diff --git a/src/render/graphicshelpers/graphicshelpergl3_p.h b/src/render/graphicshelpers/graphicshelpergl3_p.h
index 93afbd3fe..59337a690 100644
--- a/src/render/graphicshelpers/graphicshelpergl3_p.h
+++ b/src/render/graphicshelpers/graphicshelpergl3_p.h
@@ -75,6 +75,7 @@ public:
void bindUniformBlock(GLuint programId, GLuint uniformBlockIndex, GLuint uniformBlockBinding) Q_DECL_OVERRIDE;
void bindUniform(const QVariant &v, const ShaderUniform &description) Q_DECL_OVERRIDE;
void blendEquation(GLenum mode) Q_DECL_OVERRIDE;
+ void blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor) Q_DECL_OVERRIDE;
GLuint boundFrameBufferObject() Q_DECL_OVERRIDE;
void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer) Q_DECL_OVERRIDE;
bool checkFrameBufferComplete() Q_DECL_OVERRIDE;
diff --git a/src/render/graphicshelpers/graphicshelpergl4.cpp b/src/render/graphicshelpers/graphicshelpergl4.cpp
index dfd09cafd..74f7b4d4f 100644
--- a/src/render/graphicshelpers/graphicshelpergl4.cpp
+++ b/src/render/graphicshelpers/graphicshelpergl4.cpp
@@ -216,6 +216,11 @@ void GraphicsHelperGL4::blendEquation(GLenum mode)
m_funcs->glBlendEquation(mode);
}
+void GraphicsHelperGL4::blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
+{
+ m_funcs->glBlendFunci(buf, sfactor, dfactor);
+}
+
void GraphicsHelperGL4::alphaTest(GLenum, GLenum)
{
qCWarning(Render::Rendering) << "AlphaTest not available with OpenGL 3.2 core";
diff --git a/src/render/graphicshelpers/graphicshelpergl4_p.h b/src/render/graphicshelpers/graphicshelpergl4_p.h
index 68916062b..0ed007482 100644
--- a/src/render/graphicshelpers/graphicshelpergl4_p.h
+++ b/src/render/graphicshelpers/graphicshelpergl4_p.h
@@ -74,6 +74,7 @@ public:
void bindUniformBlock(GLuint programId, GLuint uniformBlockIndex, GLuint uniformBlockBinding) Q_DECL_OVERRIDE;
void bindUniform(const QVariant &v, const ShaderUniform &description) Q_DECL_OVERRIDE;
void blendEquation(GLenum mode) Q_DECL_OVERRIDE;
+ void blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor) Q_DECL_OVERRIDE;
GLuint boundFrameBufferObject() Q_DECL_OVERRIDE;
void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer) Q_DECL_OVERRIDE;
bool checkFrameBufferComplete() Q_DECL_OVERRIDE;
diff --git a/src/render/graphicshelpers/graphicshelperinterface_p.h b/src/render/graphicshelpers/graphicshelperinterface_p.h
index b959b63ae..15c950253 100644
--- a/src/render/graphicshelpers/graphicshelperinterface_p.h
+++ b/src/render/graphicshelpers/graphicshelperinterface_p.h
@@ -82,6 +82,7 @@ public:
virtual void bindUniformBlock(GLuint programId, GLuint uniformBlockIndex, GLuint uniformBlockBinding) = 0;
virtual void bindUniform(const QVariant &v, const ShaderUniform &description) = 0;
virtual void blendEquation(GLenum mode) = 0;
+ virtual void blendFunci(GLuint buf, GLenum sfactor, GLenum dfactor) = 0;
virtual GLuint boundFrameBufferObject() = 0;
virtual void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer) = 0;
virtual bool checkFrameBufferComplete() = 0;