From da6cf7f8956bc33b5a20c6e62f75a8de1a2d6af2 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 10 Sep 2009 08:12:45 +1000 Subject: Document why an FBO of 0 needs to be bound in QGLPaintBuffer sometimes Reviewed-by: trustme --- src/opengl/qglpaintdevice.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp index 7dac55d..8863b01 100644 --- a/src/opengl/qglpaintdevice.cpp +++ b/src/opengl/qglpaintdevice.cpp @@ -70,6 +70,12 @@ void QGLPaintDevice::beginPaint() // Record the currently bound FBO so we can restore it again // in endPaint() and bind this device's FBO + // + // Note: m_thisFBO could be zero if the paint device is not + // backed by an FBO (e.g. window back buffer). But there could + // be a previous FBO bound to the context which we need to + // explicitly unbind. Otherwise the painting will go into + // the previous FBO instead of to the window. m_previousFBO = ctx->d_func()->current_fbo; if (m_previousFBO != m_thisFBO) { ctx->d_ptr->current_fbo = m_thisFBO; -- cgit v0.12