Hmmm take a look at this [qt-project.org]. But use QSGSimpleTextureNode instead of QSGGeometryNode. A simple rendering can look like this.
QSGNode *YourClass::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) {
QSGNode *node = oldNode;
if (!node) {
node = new QSGNode();
}
if (this->_fbo == NULL) {
this->_fbo = new QGLFramebufferObject(QSize(this->boundingRect().width(), this->boundingRect().height()));
QSGTexture *m_texture = this->window()->createTextureFromId(this->_fbo->texture(),QSize(this->boundingRect().width(), this->boundingRect().height()), QQuickWindow::TextureHasAlphaChannel);
QSGSimpleTextureNode *textureNode = new QSGSimpleTextureNode();
textureNode->setTexture(m_texture);
textureNode->setTextureCoordinatesTransform(QSGSimpleTextureNode::MirrorVertically);
textureNode->setRect(this->boundingRect());
textureNode->setFiltering(QSGTexture::Linear);
node->appendChildNode(textureNode);
}
return node;
}
Is an example but should show how to render a backbuffer with scenegraph
↧