From 4d4580b5f43adb22b6ba95f49698efcd5dbdfeae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 11 Mar 2009 10:37:13 +0100 Subject: Fixes: Make FBO window surface work with GL 2 paint engine. RevBy: Trond Details: Need to make sure clipping/scissoring etc is turned off and that we are in a good state. --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 3 +++ src/opengl/qwindowsurface_gl.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index dbf18b1..89ed1f7 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1062,6 +1062,9 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) bool QGL2PaintEngineEx::end() { Q_D(QGL2PaintEngineEx); + QGLContext *ctx = d->ctx; + glUseProgram(0); + d->transferMode(DefaultMode); d->drawable.swapBuffers(); d->drawable.doneCurrent(); return false; diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 08c2aab..5cd4366 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -439,6 +439,9 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & if (d_ptr->fbo) d_ptr->fbo->release(); + glDisable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + glMatrixMode(GL_MODELVIEW); glLoadIdentity(); @@ -539,6 +542,7 @@ void QGLWindowSurface::updateGeometry() d_ptr->fbo->bind(); if (d_ptr->fbo->isValid()) { + qDebug() << "Created Window Surface FBO" << rect.size(); return; } else { qDebug() << "QGLWindowSurface: Failed to create valid FBO, falling back"; -- cgit v0.12