1

I want to get the default FBO between QPainter's native painting area. such as:

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();
}

Can anybody help me with this ?

S.Spieker
  • 7,005
  • 8
  • 44
  • 50
WoodyWu
  • 11
  • 3
  • Two different piece of code cannot own the window at the same time. You're either using Qt's stuff to draw to the window or you're using OpenGL. Also, the default framebuffer for a context is always FBO 0. – Nicol Bolas Jan 13 '16 at 14:08

0 Answers0