如何在QPainter原生绘画之间获得默认FBO?

时间:2016-01-13 07:59:59

标签: c++ opengl qgraphicsscene qpainter fbo

我想在QPainter的原生绘画区域之间获得默认的FBO。如:

void QGraphicsScene::drawBackground(QPainter *painter, const QRectF &rect)
{
    painter->beginNativePainting();

    unsign int defaultFBO = getDefaultFBO(); // how ?

    glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO );
    glClearColor(1, 0, 0, 1);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO );

    painter->endNativePainting();
}

有人可以帮我吗?

0 个答案:

没有答案