summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglpixelbuffer_p.h
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-09-01 13:52:44 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-09-08 16:36:14 (GMT)
commite8b5bfa8a86b2d7c79aabcc4566f740f0a9afe7c (patch)
treeb11a5707ef080a8ef94fb3e7a2e79ce38d7576a4 /src/opengl/qglpixelbuffer_p.h
parentb7963df603a315136b32297b861f089c0cd49acd (diff)
downloadQt-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/qglpixelbuffer_p.h')
-rw-r--r--src/opengl/qglpixelbuffer_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/opengl/qglpixelbuffer_p.h b/src/opengl/qglpixelbuffer_p.h
index e24d1ea..96d41d7 100644
--- a/src/opengl/qglpixelbuffer_p.h
+++ b/src/opengl/qglpixelbuffer_p.h
@@ -142,6 +142,8 @@ class QGLPBufferGLPaintDevice : public QGLPaintDevice
public:
virtual QPaintEngine* paintEngine() const {return pbuf->paintEngine();}
virtual QSize size() const {return pbuf->size();}
+ virtual QGLContext* context() const;
+ virtual void endPaint();
void setPBuffer(QGLPixelBuffer* pb);
private:
QGLPixelBuffer* pbuf;