diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-04 10:42:45 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-10-04 10:42:45 +0200 |
commit | 04f6ff77ef0c8858629766e191ecc3d4ef056848 (patch) | |
tree | d3684e21bf277bdd2b0d284042d627d97ad528db /examples | |
parent | a81fc596a3cbcc07396be1c0284f1ee8aa44ff8c (diff) | |
parent | 00a99e631459eb7e52fde822c24d7b9d603008c4 (diff) | |
download | qtwayland-04f6ff77ef0c8858629766e191ecc3d4ef056848.tar.gz |
Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta1
Change-Id: I83392c13a9cea972fbb570a9510a19f401675283
Diffstat (limited to 'examples')
-rw-r--r-- | examples/wayland/minimal-cpp/window.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/wayland/minimal-cpp/window.cpp b/examples/wayland/minimal-cpp/window.cpp index f0d0fd5d..a23bba3a 100644 --- a/examples/wayland/minimal-cpp/window.cpp +++ b/examples/wayland/minimal-cpp/window.cpp @@ -86,7 +86,8 @@ void Window::paintGL() functions->glClearColor(.4f, .7f, .1f, 0.5f); functions->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - m_textureBlitter.bind(); + GLenum currentTarget = GL_TEXTURE_2D; + m_textureBlitter.bind(currentTarget); functions->glEnable(GL_BLEND); functions->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -96,6 +97,10 @@ void Window::paintGL() auto texture = view->getTexture(); if (!texture) continue; + if (texture->target() != currentTarget) { + currentTarget = texture->target(); + m_textureBlitter.bind(currentTarget); + } GLuint textureId = texture->textureId(); QWaylandSurface *surface = view->surface(); if (surface && surface->hasContent()) { |