The QSGGeometry class provides low-level storage for graphics primitives in the QML Scene Graph. More...
#include <QSGGeometry>
class | Attribute |
class | AttributeSet |
class | ColoredPoint2D |
class | Point2D |
class | TexturedPoint2D |
QSGGeometry ( const QSGGeometry::AttributeSet & attributes, int vertexCount, int indexCount = 0, int indexType = GL_UNSIGNED_SHORT ) | |
~QSGGeometry () | |
void | allocate ( int vertexCount, int indexCount = 0 ) |
int | attributeCount () const |
const Attribute * | attributes () const |
GLenum | drawingMode () const |
int | indexCount () const |
void * | indexData () |
const void * | indexData () const |
uint * | indexDataAsUInt () |
const uint * | indexDataAsUInt () const |
quint16 * | indexDataAsUShort () |
const quint16 * | indexDataAsUShort () const |
int | indexType () const |
void | setDrawingMode ( GLenum mode ) |
int | stride () const |
int | vertexCount () const |
void * | vertexData () |
const void * | vertexData () const |
ColoredPoint2D * | vertexDataAsColoredPoint2D () |
const ColoredPoint2D * | vertexDataAsColoredPoint2D () const |
Point2D * | vertexDataAsPoint2D () |
const Point2D * | vertexDataAsPoint2D () const |
TexturedPoint2D * | vertexDataAsTexturedPoint2D () |
const TexturedPoint2D * | vertexDataAsTexturedPoint2D () const |
const AttributeSet & | defaultAttributes_ColoredPoint2D () |
const AttributeSet & | defaultAttributes_Point2D () |
const AttributeSet & | defaultAttributes_TexturedPoint2D () |
void | updateRectGeometry ( QSGGeometry * g, const QRectF & rect ) |
void | updateTexturedRectGeometry ( QSGGeometry * g, const QRectF & rect, const QRectF & textureRect ) |
The QSGGeometry class provides low-level storage for graphics primitives in the QML Scene Graph.
The QSGGeometry class provides a few convenience attributes and attribute accessors by default. The defaultAttributes_Point2D() function returns attributes to be used in normal solid color rectangles, while the defaultAttributes_TexturedPoint2D function returns attributes to be used for the common pixmap usecase.
Constructs a geometry object based on attributes.
The object allocate space for vertexCount vertices based on the accumulated size in attributes and for indexCount.
Geometry objects are constructed with GL_TRIANGLE_STRIP as default drawing mode.
The attribute structure is assumed to be POD and the geometry object assumes this will not go away. There is no memory management involved.
Resizes the vertex and index data of this geometry object to fit vertexCount vertices and indexCount indices.
Vertex and index data will be invalidated after this call and the caller must
Convenience function which returns attributes to be used for per vertex colored 2D drawing.
Convenience function which returns attributes to be used for 2D solid color drawing.
Convenience function which returns attributes to be used for textured 2D drawing.
Returns the drawing mode of this geometry.
The default value is GL_TRIANGLE_STRIP.
See also setDrawingMode().
Returns the number of indices in this geometry object.
Returns a pointer to the raw index data of this geometry object.
See also indexDataAsUShort() and indexDataAsUInt().
Returns a pointer to the raw index data of this geometry object.
See also indexDataAsUShort() and indexDataAsUInt().
Returns the primitive type used for indices in this geometry object.
Sets the drawing mode to be used for this geometry.
The default value is GL_TRIANGLE_STRIP.
See also drawingMode().
Updates the geometry g with the coordinates in rect.
The function assumes the geometry object contains a single triangle strip of QSGGeometry::Point2D vertices
Updates the geometry g with the coordinates in rect and texture coordinates from textureRect.
textureRect should be in normalized coordinates.
g is assumed to be a triangle strip of four vertices of type QSGGeometry::TexturedPoint2D.
Returns the number of vertices in this geometry object.
Returns a pointer to the raw vertex data of this geometry object.
See also vertexDataAsPoint2D() and vertexDataAsTexturedPoint2D.
Returns a pointer to the raw vertex data of this geometry object.
See also vertexDataAsPoint2D() and vertexDataAsTexturedPoint2D.