diff options
author | Alex Wilson <alex.wilson@nokia.com> | 2011-12-14 16:10:15 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-15 11:02:55 +0100 |
commit | 4bb5b4f01c1b38fce9f1a11346de5bd4ee3c6fd4 (patch) | |
tree | e95f5ea2bf8cff0a29cef8e59fa8481681f95e46 /src/quick/scenegraph/coreapi/qsgrenderer.cpp | |
parent | ad91ab8b7db93ee13db18b1284542b9853183092 (diff) |
Add lineWidth property to QSGGeometry
Allows users to set a line width when using drawingModes GL_LINES,
GL_LINE_LOOP etc. Only calls glLineWidth on these drawingModes, and
does it just before the glDrawElements/glDrawArrays.
Change-Id: I2af583970b2acf0ddb59025a454caa75a8ddbd4f
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgrenderer.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgrenderer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp index 1b4f5da435..a7aac5f42c 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp @@ -701,6 +701,10 @@ void QSGRenderer::draw(const QSGMaterialShader *shader, const QSGGeometry *g) indexData = g->indexData(); } + // Set the line width if applicable + if (g->drawingMode() == GL_LINES || g->drawingMode() == GL_LINE_STRIP || g->drawingMode() == GL_LINE_LOOP) { + glLineWidth(g->lineWidth()); + } // draw the stuff... if (g->indexCount()) { |