#include <QtQml/private/qqmlglobal_p.h>
#include <QtQuick/private/qsgdistancefieldutil_p.h>
#include <qopenglfunctions.h>
+#include <qopenglframebufferobject.h>
#include <qmath.h>
#if !defined(QT_OPENGL_ES_2)
GL_COLOR_BUFFER_BIT, GL_NEAREST);
// Reset the default framebuffer
- m_coreFuncs->glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ QOpenGLFramebufferObject::bindDefault();
return;
} else if (useTextureResizeWorkaround()) {
m_funcs->glDeleteTextures(1, &tmp_texture);
m_funcs->glDeleteTextures(1, &oldTexture);
- m_funcs->glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ QOpenGLFramebufferObject::bindDefault();
// restore render states
if (stencilTestEnabled)
void QQuickWidgetPrivate::render(bool needsSync)
{
- context->makeCurrent(offscreenSurface);
+ if (!context->makeCurrent(offscreenSurface)) {
+ qWarning("QQuickWidget: Cannot render due to failing makeCurrent()");
+ return;
+ }
+
+ QOpenGLContextPrivate::get(context)->defaultFboRedirect = fbo->handle();
if (needsSync) {
renderControl->polishItems();
}
static_cast<QOpenGLExtensions *>(context->functions())->flushShared();
+
+ QOpenGLContextPrivate::get(context)->defaultFboRedirect = 0;
}
void QQuickWidgetPrivate::renderSceneGraph()