summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl_qpa.cpp1
-rw-r--r--src/opengl/qglpaintdevice.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index 5f0bca3..b05df64 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -139,6 +139,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
}
d->platformContext = widget->platformWindow()->glContext();
Q_ASSERT(d->platformContext);
+ d->default_fbo = d->platformContext->defaultFBO();
d->glFormat = qt_platformwindowformat_to_glformat(d->platformContext->platformWindowFormat());
d->valid =(bool) d->platformContext;
}
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index e1dcbfd..e12fdae 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -166,6 +166,12 @@ void QGLWidgetGLPaintDevice::setWidget(QGLWidget* w)
void QGLWidgetGLPaintDevice::beginPaint()
{
+ // ### This should be in setWidget(), but the context of the QGLWidget
+ // hasn't been set there yet.
+#ifdef Q_WS_QPA
+ m_thisFBO = context()->d_ptr->platformContext->defaultFBO();
+#endif
+
QGLPaintDevice::beginPaint();
if (!glWidget->d_func()->disable_clear_on_painter_begin && glWidget->autoFillBackground()) {
if (glWidget->testAttribute(Qt::WA_TranslucentBackground))