summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglframebufferobject.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-10-12 01:00:06 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-10-12 01:00:06 (GMT)
commitc1f1b004f7af4c9199e73b4b02bdb4b3aaf74ea8 (patch)
treee4f10cbc420c6c4c753580df4b019bc336073b8f /src/opengl/qglframebufferobject.cpp
parent3e584d5dfaa778ccaeaeb572aecbc979f5a7ef3e (diff)
downloadQt-c1f1b004f7af4c9199e73b4b02bdb4b3aaf74ea8.zip
Qt-c1f1b004f7af4c9199e73b4b02bdb4b3aaf74ea8.tar.gz
Qt-c1f1b004f7af4c9199e73b4b02bdb4b3aaf74ea8.tar.bz2
Don't delete an fbo's texture if the fbo isn't using a texture
Also, unbind the texture after it is initialized. Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl/qglframebufferobject.cpp')
-rw-r--r--src/opengl/qglframebufferobject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 5585208..8fc95cf 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -451,6 +451,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
QT_CHECK_GLERROR();
valid = checkFramebufferStatus();
+ glBindTexture(target, 0);
color_buffer = 0;
} else {
@@ -819,7 +820,8 @@ QGLFramebufferObject::~QGLFramebufferObject()
if (isValid() && ctx) {
QGLShareContextScope scope(ctx);
- glDeleteTextures(1, &d->texture);
+ if (d->texture)
+ glDeleteTextures(1, &d->texture);
if (d->color_buffer)
glDeleteRenderbuffers(1, &d->color_buffer);
if (d->depth_stencil_buffer)