diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2017-09-21 13:51:08 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2017-09-21 12:19:29 +0000 |
commit | d4f67d8414b8ddac8fb4bd3d70ae65e20a818645 (patch) | |
tree | 126d06d236e2ca3daa3da7f5dbb0d9628ffde60d /examples | |
parent | 3cb09edd71745edda4bbe8de3a6d7ad8e4ea5f58 (diff) | |
download | qtwayland-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.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()) { |