summaryrefslogtreecommitdiffstats
path: root/src/render/backend/qgraphicshelpergl2.cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2014-09-21 12:17:21 +0100
committerSean Harmer <sean.harmer@kdab.com>2014-09-21 16:59:33 +0200
commit6d9febedb5b734541c037521c39f705c0fdbbc95 (patch)
treead2a7ee57ed73d21c66a9e38fdec5cbcc1d7a9be /src/render/backend/qgraphicshelpergl2.cpp
parentbb7d6c2b10b291a93b04dc9a1753a6eec29b68c7 (diff)
Add an example to exercise tessellation shader support
Also extended Renderer and friends to support setting the number of vertices per patch with glPathParameteri(GL_PATCH_VERTICES, n). To support this QMeshData now also stores the vertices per patch. This demonstrates how to tessellate using quad tessellation mode. Follow-up commits will add objects to show triangle and isoline modes. Change-Id: I68afb31815db430d0b4d8d9cc525efcfb9a216fc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/backend/qgraphicshelpergl2.cpp')
-rw-r--r--src/render/backend/qgraphicshelpergl2.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/render/backend/qgraphicshelpergl2.cpp b/src/render/backend/qgraphicshelpergl2.cpp
index b7b30a52c..68be92cf2 100644
--- a/src/render/backend/qgraphicshelpergl2.cpp
+++ b/src/render/backend/qgraphicshelpergl2.cpp
@@ -120,6 +120,12 @@ void QGraphicsHelperGL2::drawArrays(GLenum primitiveType,
count);
}
+void QGraphicsHelperGL2::setVerticesPerPatch(GLint verticesPerPatch)
+{
+ Q_UNUSED(verticesPerPatch);
+ qWarning() << "Tessellation not supported with OpenGL 2";
+}
+
void QGraphicsHelperGL2::useProgram(GLuint programId)
{
m_funcs->glUseProgram(programId);
@@ -270,6 +276,8 @@ bool QGraphicsHelperGL2::supportsFeature(QGraphicsHelperInterface::Feature featu
switch (feature) {
case MRT:
return (m_fboFuncs != Q_NULLPTR);
+ case Tessellation:
+ return false;
default:
return false;
}