From f370b5d986529155baf7d9dd95678854df4105e0 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 9 Oct 2009 14:57:00 +1000 Subject: Check the framebuffer format against a format, not a texture target The previous code was comparing QGLFramebufferObjectFormat::textureTarget() against GL_RGB to determine if alpha was present. This should be internalTextureFormat() instead. Reviewed-by: Sarah Smith --- src/opengl/qglframebufferobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 3e54b35..5585208 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -988,7 +988,7 @@ QImage QGLFramebufferObject::toImage() const bool wasBound = isBound(); if (!wasBound) const_cast(this)->bind(); - QImage image = qt_gl_read_framebuffer(d->size, format().textureTarget() != GL_RGB, true); + QImage image = qt_gl_read_framebuffer(d->size, format().internalTextureFormat() != GL_RGB, true); if (!wasBound) const_cast(this)->release(); -- cgit v0.12