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

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

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes