aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/quickwidgets/qquickviewcomparison
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/quickwidgets/qquickviewcomparison')
-rw-r--r--examples/quick/quickwidgets/qquickviewcomparison/fbitem.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/quick/quickwidgets/qquickviewcomparison/fbitem.cpp b/examples/quick/quickwidgets/qquickviewcomparison/fbitem.cpp
index 3b9f2e97f3..d418a6be99 100644
--- a/examples/quick/quickwidgets/qquickviewcomparison/fbitem.cpp
+++ b/examples/quick/quickwidgets/qquickviewcomparison/fbitem.cpp
@@ -162,8 +162,9 @@ void FbItemRenderer::render()
{
ensureInit();
- QOpenGLVertexArrayObject::Binder vaoBinder(&m_vao);
- if (!m_vao.isCreated())
+ if (m_vao.isCreated())
+ m_vao.bind();
+ else
setupVertexAttribs();
StateBinder state(this);
@@ -182,6 +183,9 @@ void FbItemRenderer::render()
updateDirtyUniforms();
f->glDrawArrays(GL_TRIANGLES, 0, m_logo.vertexCount());
+
+ if (m_vao.isCreated())
+ m_vao.release();
}
QOpenGLFramebufferObject *FbItemRenderer::createFramebufferObject(const QSize &size)
@@ -209,7 +213,6 @@ void FbItemRenderer::ensureInit()
void FbItemRenderer::initBuf()
{
- m_vao.create();
QOpenGLVertexArrayObject::Binder vaoBinder(&m_vao);
m_logoVbo.create();