summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglframebufferobject.cpp
diff options
context:
space:
mode:
authorJani Hautakangas <jani.hautakangas@nokia.com>2010-10-19 15:48:01 (GMT)
committerJani Hautakangas <jani.hautakangas@nokia.com>2010-10-20 08:41:29 (GMT)
commit26b5a9c67f8c4f8bf4cace5c189f506d3f89f3ce (patch)
tree8c930b985c5779e13ad4b319f94b7423ae748b21 /src/opengl/qglframebufferobject.cpp
parent4d93a4eccb462ce3bee75f0c3961901d60bcae02 (diff)
downloadQt-26b5a9c67f8c4f8bf4cace5c189f506d3f89f3ce.zip
Qt-26b5a9c67f8c4f8bf4cace5c189f506d3f89f3ce.tar.gz
Qt-26b5a9c67f8c4f8bf4cace5c189f506d3f89f3ce.tar.bz2
Fix GL_OES_element_index_uint and add GL_OES_depth24 detection.
GL_OES_element_index_uint detection was not working because EGL config wasn't yet resolved. In addition QFrameBufferObject should use 24bit depth render buffer if extension is available. Task-number: QTBUG-14542 Reviewed-by: Gunnar
Diffstat (limited to 'src/opengl/qglframebufferobject.cpp')
-rw-r--r--src/opengl/qglframebufferobject.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 6c9b288..a1472f7 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -508,17 +508,26 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
Q_ASSERT(glIsRenderbuffer(depth_buffer));
if (samples != 0 && glRenderbufferStorageMultisampleEXT) {
#ifdef QT_OPENGL_ES
-#define GL_DEPTH_COMPONENT16 0x81A5
- glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
- GL_DEPTH_COMPONENT16, size.width(), size.height());
+ if (QGLExtensions::glExtensions() & QGLExtensions::Depth24) {
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
+ GL_DEPTH_COMPONENT24_OES, size.width(), size.height());
+ } else {
+ glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
+ GL_DEPTH_COMPONENT16, size.width(), size.height());
+ }
#else
glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples,
GL_DEPTH_COMPONENT, size.width(), size.height());
#endif
} else {
#ifdef QT_OPENGL_ES
-#define GL_DEPTH_COMPONENT16 0x81A5
- glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, size.width(), size.height());
+ if (QGLExtensions::glExtensions() & QGLExtensions::Depth24) {
+ glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24_OES,
+ size.width(), size.height());
+ } else {
+ glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16,
+ size.width(), size.height());
+ }
#else
glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, size.width(), size.height());
#endif