本文整理汇总了C++中QSGGeometry::drawingMode方法的典型用法代码示例。如果您正苦于以下问题:C++ QSGGeometry::drawingMode方法的具体用法?C++ QSGGeometry::drawingMode怎么用?C++ QSGGeometry::drawingMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSGGeometry
的用法示例。
在下文中一共展示了QSGGeometry::drawingMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compareSelectionNode
void compareSelectionNode(QSGNode *node, const QRectF &rect, int selectionId)
{
QSGGeometryNode *geometryNode = static_cast<QSGGeometryNode *>(node);
QSGGeometry *geometry = geometryNode->geometry();
QCOMPARE(geometry->vertexCount(), 4);
QCOMPARE(geometry->drawingMode(), (GLenum)GL_TRIANGLE_STRIP);
OpaqueColoredPoint2DWithSize *data =
static_cast<OpaqueColoredPoint2DWithSize *>(geometry->vertexData());
float *lowerLeft = reinterpret_cast<float *>(data);
float *lowerRight = reinterpret_cast<float *>(++data);
float *upperLeft = reinterpret_cast<float *>(++data);
float *upperRight = reinterpret_cast<float *>(++data);
QCOMPARE(QRectF(QPointF(upperLeft[0], upperLeft[1]), QPointF(lowerRight[0], lowerRight[1])),
rect);
QCOMPARE(lowerRight[0], upperRight[0]);
QCOMPARE(lowerRight[1], lowerLeft[1]);
QCOMPARE(upperLeft[0], lowerLeft[0]);
QCOMPARE(upperLeft[1], upperRight[1]);
QCOMPARE(int(lowerLeft[4]), selectionId);
QCOMPARE(int(lowerRight[4]), selectionId);
QCOMPARE(int(upperLeft[4]), selectionId);
QCOMPARE(int(upperRight[4]), selectionId);
TimelineItemsMaterial *material = static_cast<TimelineItemsMaterial *>(
geometryNode->material());
QVERIFY(!(material->flags() & QSGMaterial::Blending));
}
示例2: setObject
bool SGGeometryExtension::setObject(void* object, const QString& typeName)
{
if (typeName == "QSGGeometryNode") {
m_node = static_cast<QSGGeometryNode*>(object);
m_model->setNode(m_node);
QSGGeometry *geometry = m_node->geometry();
emit geometryChanged(geometry->drawingMode(),
QByteArray::fromRawData(reinterpret_cast<char*>(geometry->indexData()), geometry->indexCount()*geometry->sizeOfIndex()),
geometry->indexType());
return true;
}
return false;
}