why QSGTexture::WrapMode::Repeat not work?
Unsolved
General and Desktop
-
void shapeObject::setQSGColor(QSGGeometryNode& aNode, const QColor& aColor){
QSGOpaqueTextureMaterial *material = new QSGOpaqueTextureMaterial();auto img = QImage(4, 1, QImage::Format_ARGB32); img.fill("transparent"); { QPainter pnt(&img); pnt.fillRect(0, 0, 2, 1, aColor); } auto txt = m_window->window()->createTextureFromImage(img); txt->setHorizontalWrapMode(QSGTexture::WrapMode::Repeat); //not work!? material->setTexture(txt); aNode.setMaterial(material); aNode.setFlag(QSGNode::OwnsMaterial); aNode.markDirty(QSGNode::DirtyMaterial);
}
whatever which wrapmode I set for the texture, it always works as the QSGTexture::WrapMode::ClampToEdge for the coordinates being out of [0, 1].
Is this a bug? My Qt version is Qt5.12.2? Or is there anything wrong for my codes?