diff options
author | Svenn-Arne Dragly <s@dragly.com> | 2018-10-15 19:21:34 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@qt.io> | 2018-10-16 07:19:05 +0000 |
commit | 7f75012d2efd597605eb031660d8929c6a3bcb04 (patch) | |
tree | 48df9930c38b7b23d99a79d87fcb9209cf53f61c /src/runtime/dragon/dragonactivatedsurface.cpp | |
parent | 39e41cedc7cca3bf951177d9afb6e5960a981280 (diff) |
Add support for the Dragon render aspect in Studio3D
The Dragon render aspect can be enabled by setting
dragonRenderAspectEnabled: true
on a Presentation item.
Change-Id: Ic21b5493d1bdfc4a1de9ff4a4ad643b2ad72c7ed
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/runtime/dragon/dragonactivatedsurface.cpp')
-rw-r--r-- | src/runtime/dragon/dragonactivatedsurface.cpp | 10 |
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) \ |