summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-09-21 13:51:08 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2017-09-21 12:19:29 +0000
commitd4f67d8414b8ddac8fb4bd3d70ae65e20a818645 (patch)
tree126d06d236e2ca3daa3da7f5dbb0d9628ffde60d /examples
parent3cb09edd71745edda4bbe8de3a6d7ad8e4ea5f58 (diff)
downloadqtwayland-d4f67d8414b8ddac8fb4bd3d70ae65e20a818645.tar.gz
Make minimal-cpp work with EGLStreams
Redo change 955ac0d0eeaf2f543676b649291558f4dcce37c3 for the minimal compositor example. EGL_KHR_stream_consumer_gltexture only allows connecting to the texture bound to GL_TEXTURE_EXTERNAL_OES, meaning that assumptions about the target always being GL_TEXTURE_2D break horribly. Change-Id: If5b21d740eb80486e4f55bee843a820f0b0edd60 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/minimal-cpp/window.cpp7
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()) {