summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-01-26 11:44:05 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-27 10:58:32 +0100
commit2d39471897f0a3a769406ec9c2b39558ebd45af3 (patch)
tree8c417f4ba814e9dbe70e56bdbf8a13cc46b3827f /src/opengl
parent365b5f7a9271e5fc503b10e6c17371d76643fc94 (diff)
Introduced QOpenGLContext::defaultFramebufferObject().
Also add some debugging helpers to make sure applications are correctly written even on less restrictive platforms. Change-Id: Ie92e497c32e07b2b83662f7ab5540d8f37777fd0 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qglfunctions.cpp3
-rw-r--r--src/opengl/qglfunctions.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp
index 2a11ee6a28..6e640b0fe7 100644
--- a/src/opengl/qglfunctions.cpp
+++ b/src/opengl/qglfunctions.cpp
@@ -395,6 +395,9 @@ void QGLFunctions::initializeGLFunctions(const QGLContext *context)
Convenience function that calls glBindFramebuffer(\a target, \a framebuffer).
+ Note that Qt will translate a \a framebuffer argument of 0 to the currently
+ bound QOpenGLContext's defaultFramebufferObject().
+
For more information, see the OpenGL/ES 2.0 documentation for
\l{http://www.khronos.org/opengles/sdk/docs/man/glBindFramebuffer.xml}{glBindFramebuffer()}.
*/
diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h
index af6c583a10..40c00f1af8 100644
--- a/src/opengl/qglfunctions.h
+++ b/src/opengl/qglfunctions.h
@@ -48,6 +48,7 @@
#endif
#include <QtOpenGL/qgl.h>
+#include <QtGui/qopenglcontext.h>
QT_BEGIN_HEADER
@@ -450,6 +451,8 @@ inline void QGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
inline void QGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
{
+ if (framebuffer == 0)
+ framebuffer = QOpenGLContext::currentContext()->defaultFramebufferObject();
#if defined(QT_OPENGL_ES_2)
::glBindFramebuffer(target, framebuffer);
#else