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

    GL_TEXTURE_MIN_FILTER -> GL_NEAREST
    GL_TEXTURE_MAG_FILTER -> GL_NEAREST
    

    By default (https://code.woboq.org/qt5/qtbase/src/gui/opengl/qopenglframebufferobject.cpp.html#516)

    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.

    Like:
    ```
    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



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.