Nominate our 2022 Qt Champions!

How to set GL_LINEAR as default on QOpenGLFramebufferObject ?

  • I'm having scaling issues while rendering from a hw surface and I've discovered that's because QOpenGLFramebufferObject has set


    By default (

    How can I change this to be GL_LINEAR ? There's not public api for that but I'm pretty sure that should be a way to do this, as it's something more than one will need to change..

  • If found the way by myself, if this can help to someone, is a question of attaching the texture again and change it before the fbo generation.

    glBindTexture(GL_TEXTURE_2D, d->fbo->texture());
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // Linear Filtering
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Linear Filtering