diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-11-05 13:14:52 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-11-05 13:36:20 (GMT) |
commit | 0818c05f22509a4ee9310f1d313460f422d9d32b (patch) | |
tree | 1cba7ad012364e6efd6d9c16c37f90d715e56340 /src/opengl/qglframebufferobject.cpp | |
parent | 83052dc7c7ddb8169e1e5607a2fb2f9c6097c6f0 (diff) | |
download | Qt-0818c05f22509a4ee9310f1d313460f422d9d32b.zip Qt-0818c05f22509a4ee9310f1d313460f422d9d32b.tar.gz Qt-0818c05f22509a4ee9310f1d313460f422d9d32b.tar.bz2 |
Fix docs for QGLFramebufferObject & add warnings in bind/release
Warnings are for binding/releasing when the current context isn't in the
same context group as the FBO was created in.
Reviewed-By: Trond
Diffstat (limited to 'src/opengl/qglframebufferobject.cpp')
-rw-r--r-- | src/opengl/qglframebufferobject.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index ddb107e..d79283e 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -846,13 +846,6 @@ bool QGLFramebufferObject::isValid() const framebuffer to this framebuffer object. Returns true upon success, false otherwise. - Since 4.6: if another QGLFramebufferObject instance was already bound - to the current context, then its handle() will be remembered and - automatically restored when release() is called. This allows multiple - framebuffer rendering targets to be stacked up. It is important that - release() is called on the stacked framebuffer objects in the reverse - order of the calls to bind(). - \sa release() */ bool QGLFramebufferObject::bind() @@ -864,6 +857,13 @@ bool QGLFramebufferObject::bind() if (!ctx) return false; // Context no longer exists. const QGLContext *current = QGLContext::currentContext(); +#ifdef QT_DEBUG + if (!current || + QGLContextPrivate::contextGroup(current) != QGLContextPrivate::contextGroup(ctx)) + { + qWarning("QGLFramebufferObject::bind() called from incompatible context"); + } +#endif glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->fbo()); d->valid = d->checkFramebufferStatus(); if (d->valid && current) @@ -889,6 +889,15 @@ bool QGLFramebufferObject::release() return false; // Context no longer exists. const QGLContext *current = QGLContext::currentContext(); + +#ifdef QT_DEBUG + if (!current || + QGLContextPrivate::contextGroup(current) != QGLContextPrivate::contextGroup(ctx)) + { + qWarning("QGLFramebufferObject::release() called from incompatible context"); + } +#endif + if (current) { current->d_ptr->current_fbo = 0; glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0); |