diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-10-02 07:55:26 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-10-02 09:39:01 (GMT) |
commit | 46c17756dfa231d5ce7a8907330d97807880a04c (patch) | |
tree | 6f53a0e0432b4e47f691bbcb49ab7b10d2f1a924 /src/opengl | |
parent | b89129e66bc1a7026ee86e01543d907ba9d47d02 (diff) | |
download | Qt-46c17756dfa231d5ce7a8907330d97807880a04c.zip Qt-46c17756dfa231d5ce7a8907330d97807880a04c.tar.gz Qt-46c17756dfa231d5ce7a8907330d97807880a04c.tar.bz2 |
Make 16-bit graphicssystem opengl work
Reviewed-by: Eskil
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qgl_x11egl.cpp | 12 | ||||
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 6 |
2 files changed, 17 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; diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 3a348bc..7f8577a 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -306,8 +306,13 @@ QGLWindowSurface::QGLWindowSurface(QWidget *window) d_ptr->pb = 0; d_ptr->fbo = 0; d_ptr->ctx = 0; +#if defined (QT_OPENGL_ES_2) + d_ptr->tried_fbo = true; + d_ptr->tried_pb = true; +#else d_ptr->tried_fbo = false; d_ptr->tried_pb = false; +#endif d_ptr->destructive_swap_buffers = qgetenv("QT_GL_SWAPBUFFER_PRESERVE").isNull(); d_ptr->glDevice.d = d_ptr; d_ptr->q_ptr = this; @@ -438,6 +443,7 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & QRect rect = br.translated(-offset - wOffset); const GLenum target = GL_TEXTURE_2D; + Q_UNUSED(target); if (context()) { context()->makeCurrent(); |