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

Andrew Haigh andrew.haigh at cellsoftware.co.uk
Wed Dec 21 09:53:22 CET 2016


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:

 
<https://github.com/qt/qtbase/blob/dev/src/plugins/platforms/android/qandroi
dplatformintegration.cpp>
https://github.com/qt/qtbase/blob/dev/src/plugins/platforms/android/qandroid
platformintegration.cpp
...
QPlatformOpenGLContext
*QAndroidPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext
*context) const
{
QSurfaceFormat format(context->format());
format.setAlphaBufferSize(8);
format.setRedBufferSize(8);
format.setGreenBufferSize(8);
format.setBlueBufferSize(8);
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...

 

Andrew Haigh

Senior Technical Architect

Cell Software Services Ltd

Email:  <mailto:andrew.haigh at cellsoftware.co.uk>
andrew.haigh at cellsoftware.co.uk

Skype: andrew.haigh_5

Mobile: +44(0)7411378083

 



 

 

 

 



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20161221/f0289292/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 2524 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/android-development/attachments/20161221/f0289292/attachment.jpg>


More information about the Android-development mailing list