summaryrefslogtreecommitdiffstats
path: root/src/runtime/dragon/dragonactivatedsurface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/dragon/dragonactivatedsurface.cpp')
-rw-r--r--src/runtime/dragon/dragonactivatedsurface.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/runtime/dragon/dragonactivatedsurface.cpp b/src/runtime/dragon/dragonactivatedsurface.cpp
index 2657be9..e485759 100644
--- a/src/runtime/dragon/dragonactivatedsurface.cpp
+++ b/src/runtime/dragon/dragonactivatedsurface.cpp
@@ -420,9 +420,9 @@ void ActivatedSurface::applyUniform(const ShaderUniform &description, const Unif
}
}
-DrawContext ActivatedSurface::beginDrawing()
+DrawContext ActivatedSurface::beginDrawing(bool autoSwapBuffers)
{
- return DrawContext(m_glContext, m_surface);
+ return DrawContext(m_glContext, m_surface, autoSwapBuffers);
}
UniformValue standardUniformValue(StandardUniform standardUniformType,
@@ -1661,14 +1661,16 @@ void ActivatedSurface::blitFramebuffer(const BlitFramebufferInfo &blitFramebuffe
}
}
-DrawContext::DrawContext(QOpenGLContext *openGLContext, QSurface *surface)
+DrawContext::DrawContext(QOpenGLContext *openGLContext, QSurface *surface, bool autoSwapBuffers)
: m_openGLContext(openGLContext)
, m_surface(surface)
+ , m_autoSwapBuffers(autoSwapBuffers)
{ }
DrawContext::~DrawContext()
{
- m_openGLContext->swapBuffers(m_surface);
+ if (m_autoSwapBuffers)
+ m_openGLContext->swapBuffers(m_surface);
}
#define QT3D_DRAGON_UNIFORM_TYPE_IMPL(UniformTypeEnum, BaseType, Func) \