diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-09-25 18:55:37 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-09-25 18:55:37 +0200 |
commit | d483ed2927cb8d4685d5d3c7ea1c71246381910b (patch) | |
tree | c529ddaf93847cca42d8165d337bc5e16668a4a1 | |
parent | ab74f068e3fbba125c36ae77f59b0e291c181e83 (diff) | |
parent | d4f67d8414b8ddac8fb4bd3d70ae65e20a818645 (diff) | |
download | qtwayland-5.9.2.tar.gz |
Change-Id: I13840441f4beeb8160efc40047e0648891349394
-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 68f206fc..89337183 100644 --- a/examples/wayland/minimal-cpp/window.cpp +++ b/examples/wayland/minimal-cpp/window.cpp @@ -85,7 +85,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); @@ -97,6 +98,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()) { |