Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-6204

Window surface FBO can become unbound when mixing QPainter and raw GL commands

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.6.1
    • 4.6.0
    • GUI: OpenGL
    • None
    • c0b81480b2909b18ac15bdd124a562ae005c2f41

    Description

      When using a regular QWidget and the GL graphics system for direct GL painting, the user can cause the window surface's fbo to become unbound.

      void MyWidget::paintEvent(QPaintEvent *e)
      {
          QPainter painter(this); // bound fbo is set to window surface's fbo
          painter.beginNativePainting();
          fbo->bind();
          glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
          glClear(GL_COLOR_BUFFER_BIT);
          fbo->release();  // returns bound fbo to 0
          glClearColor(1.0f, 1.0f, 0.0f, 1.0f);
          glClear(GL_COLOR_BUFFER_BIT); // renders to raw context surface, not fbo
          painter.endNativePainting();
      }
      

      The GL graphics system possibly needs to record the window surface fbo in the context so that it can be automatically rebound when a user-defined fbo is released.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rweather Rhys Weatherley (closed Nokia identity) (Inactive)
            rweather Rhys Weatherley (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes