diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-11-05 13:14:52 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-11-06 13:07:37 (GMT) |
commit | ce2316f466195054a3c02507ef27d548ee08410c (patch) | |
tree | 564b0ae1b9ad677022639b3273f887fefb39214c | |
parent | cd6ed59d6a7592231ec7cc21598f160d4ba03dbe (diff) | |
download | Qt-ce2316f466195054a3c02507ef27d548ee08410c.zip Qt-ce2316f466195054a3c02507ef27d548ee08410c.tar.gz Qt-ce2316f466195054a3c02507ef27d548ee08410c.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
-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); |