summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_x11egl.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-02 07:55:26 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-10-02 09:39:01 (GMT)
commit46c17756dfa231d5ce7a8907330d97807880a04c (patch)
tree6f53a0e0432b4e47f691bbcb49ab7b10d2f1a924 /src/opengl/qgl_x11egl.cpp
parentb89129e66bc1a7026ee86e01543d907ba9d47d02 (diff)
downloadQt-46c17756dfa231d5ce7a8907330d97807880a04c.zip
Qt-46c17756dfa231d5ce7a8907330d97807880a04c.tar.gz
Qt-46c17756dfa231d5ce7a8907330d97807880a04c.tar.bz2
Make 16-bit graphicssystem opengl work
Reviewed-by: Eskil
Diffstat (limited to 'src/opengl/qgl_x11egl.cpp')
-rw-r--r--src/opengl/qgl_x11egl.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 67f391b..70b2013 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -86,9 +86,19 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
qt_egl_add_platform_config(configProps, device());
configProps.setRenderableType(QEgl::OpenGL);
+ QEgl::PixelFormatMatch matchType = QEgl::BestPixelFormat;
+ if (device()->depth() == 16) {
+ configProps.setValue(EGL_RED_SIZE, 5);
+ configProps.setValue(EGL_GREEN_SIZE, 6);
+ configProps.setValue(EGL_BLUE_SIZE, 5);
+ configProps.setValue(EGL_ALPHA_SIZE, 0);
+ matchType = QEgl::ExactPixelFormat;
+ }
+ configProps.setRenderableType(QEgl::OpenGL);
+
// Search for a matching configuration, reducing the complexity
// each time until we get something that matches.
- if (!d->eglContext->chooseConfig(configProps, QEgl::BestPixelFormat)) {
+ if (!d->eglContext->chooseConfig(configProps, matchType)) {
delete d->eglContext;
d->eglContext = 0;
return false;