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

QOpenGLContext::setFormat() does not set the color depth

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0 RC1
    • 5.3.0 Alpha
    • GUI: OpenGL
    • None
    • Qt 5.3

    Description

      This 'old' code correctly sets the bit depth:

      QGLFormat gfrmt;
      gfrmt.setRedBufferSize(6);
      gfrmt.setBlueBufferSize(6);
      gfrmt.setGreenBufferSize(6);
      QGLContext *glc = new QGLContext(gfrmt);
      glc->create();
      qDebug() << "QGLContext red buffer size:" << glc->format().redBufferSize();

      This 'new' code always uses 8-bit:
      QSurfaceFormat ogfrmt;
      ogfrmt.setRedBufferSize(6);
      ogfrmt.setGreenBufferSize(6);
      ogfrmt.setBlueBufferSize(6);
      QOpenGLContext *oglc = new QOpenGLContext;
      oglc->setFormat(ogfrmt);
      oglc->create();
      qDebug() << "QOpenGLContext red buffer size:" << oglc->format().redBufferSize();

      When digging into the code, I found out that in the function qcgl_createNSOpenGLPixelFormat() the color depth nor the alpha depth is set.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-37411
          # Subject Branch Project Status CR V

          Activity

            People

              kurt.pattyn Kurt Pattyn
              kurt.pattyn Kurt Pattyn
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes