Qt World Summit: Register Today!

OpenGL on Android - seems colour depth is hardcoded to 8bpp per colour?

  • Hi,
    I've a pre-existing C++ library which renders to an externally supplier OpenGL context, and it wants a buffer format which is RGB565 (no alpha channel). But trying to configure this via QSurfaceFormat() just doesnt seem to change from 8bpp for Alpha, Red, Green, and Blue channels. When I looked into the Android platform abstraction code, I saw this:

    QPlatformOpenGLContext *QAndroidPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
    QSurfaceFormat format(context->format());
    return new QAndroidPlatformOpenGLContext(format, context->shareHandle(), m_eglDisplay);

    Can anyone explain why this is, and is it possible to change the surface format as I want? I am sure the underlying device supports it, as this library is used in other applications without problems...

  • Lifetime Qt Champion


    You should rather bring that questions to the Qt Android development mailing list. You'll find there Qt Android port developers/maintainers. This forum is more user oriented.

  • Thanks, I have asked the question there. When I have some time, I will see about checking for sure that this is the code path that is followed in the plugin, but dont have a debug build of Qt at present to step through.

Log in to reply