aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi/qsggeometry.cpp
diff options
context:
space:
mode:
authorAlex Wilson <alex.wilson@nokia.com>2011-12-14 16:10:15 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-15 11:02:55 +0100
commit4bb5b4f01c1b38fce9f1a11346de5bd4ee3c6fd4 (patch)
treee95f5ea2bf8cff0a29cef8e59fa8481681f95e46 /src/quick/scenegraph/coreapi/qsggeometry.cpp
parentad91ab8b7db93ee13db18b1284542b9853183092 (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/qsggeometry.cpp')
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.cpp b/src/quick/scenegraph/coreapi/qsggeometry.cpp
index 8661c9af93..b747bb96e3 100644
--- a/src/quick/scenegraph/coreapi/qsggeometry.cpp
+++ b/src/quick/scenegraph/coreapi/qsggeometry.cpp
@@ -138,6 +138,7 @@ QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes,
, m_owns_data(false)
, m_index_usage_pattern(AlwaysUploadPattern)
, m_vertex_usage_pattern(AlwaysUploadPattern)
+ , m_line_width(1.0)
{
Q_ASSERT(m_attributes.count > 0);
Q_ASSERT(m_attributes.stride > 0);
@@ -253,6 +254,30 @@ void QSGGeometry::setDrawingMode(GLenum mode)
}
/*!
+ Gets the current line width to be used for this geometry. This property only
+ applies where the drawingMode is GL_LINES or a related value.
+
+ The default value is 1.0
+
+ \sa setLineWidth(), drawingMode()
+*/
+float QSGGeometry::lineWidth() const
+{
+ return m_line_width;
+}
+
+/*!
+ Sets the line width to be used for this geometry. This property only applies
+ where the drawingMode is GL_LINES or a related value.
+
+ \sa lineWidth(), drawingMode()
+*/
+void QSGGeometry::setLineWidth(float w)
+{
+ m_line_width = w;
+}
+
+/*!
\fn int QSGGeometry::drawingMode() const
Returns the drawing mode of this geometry.