diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-09-01 13:52:44 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-09-08 16:36:14 (GMT) |
commit | e8b5bfa8a86b2d7c79aabcc4566f740f0a9afe7c (patch) | |
tree | b11a5707ef080a8ef94fb3e7a2e79ce38d7576a4 /src/opengl/qglframebufferobject.h | |
parent | b7963df603a315136b32297b861f089c0cd49acd (diff) | |
download | Qt-e8b5bfa8a86b2d7c79aabcc4566f740f0a9afe7c.zip Qt-e8b5bfa8a86b2d7c79aabcc4566f740f0a9afe7c.tar.gz Qt-e8b5bfa8a86b2d7c79aabcc4566f740f0a9afe7c.tar.bz2 |
Make QGLFramebufferObject work again using new QGLPaintDevice API
This patch also refactors QGL2PaintEngineEx::ensureActive() and the
logic which handles multiple paint engines rendering to the same
QGLContext. In a nut-shell:
* QGLPaintDevice::beginPaint() stores the currently bound FBO
* QGLPaintDevice::ensureActiveTarget() makes sure that GL rendering will
end up in the paint device (I.e. the right context is current and the
right FBO is bound). If a different context or FBO was bound, it is
_not_ remembered.
* QGLPaintDevice::endPaint() restores whatever FBO was bound when
beginPaint() was called.
This logic allows interleaved painter rendering to multiple FBOs and
contexts to work as expected. It also allows a stacked begin/end to work
properly when it's mixed with native GL rendering (as far as current
render target is concerened. GL state clobbering is obviously a
different topic).
QGLPaintDevice::context() also had to be made virtual as there's no good
place to call setContext. This might be possible to change in the future
though.
Finally, to make this work, QGLFramebufferObjectPrivate had to be moved
into it's own private header.
Diffstat (limited to 'src/opengl/qglframebufferobject.h')
-rw-r--r-- | src/opengl/qglframebufferobject.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h index 2778ec5..29b1f97 100644 --- a/src/opengl/qglframebufferobject.h +++ b/src/opengl/qglframebufferobject.h @@ -130,7 +130,9 @@ protected: private: Q_DISABLE_COPY(QGLFramebufferObject) QScopedPointer<QGLFramebufferObjectPrivate> d_ptr; - friend class QGLDrawable; +// friend class QGLDrawable; + friend class QGLPaintDevice; + friend class QGLFBOGLPaintDevice; }; class QGLFramebufferObjectFormatPrivate; |