当前位置: 首页>>代码示例>>C++>>正文


C++ QSGGeometry::drawingMode方法代码示例

本文整理汇总了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));
}
开发者ID:UIKit0,项目名称:qt-creator,代码行数:29,代码来源:tst_timelineselectionrenderpass.cpp

示例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;
}
开发者ID:motto0808,项目名称:GammaRay,代码行数:14,代码来源:sggeometryextension.cpp


注:本文中的QSGGeometry::drawingMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。