, 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);
}
/*!
+ 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.
void markIndexDataDirty();
void markVertexDataDirty();
+ float lineWidth() const;
+ void setLineWidth(float w);
+
private:
friend class QSGGeometryData;
uint m_reserved_bits : 27;
float m_prealloc[16];
+
+ float m_line_width;
};
inline uint *QSGGeometry::indexDataAsUInt()
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()) {