summaryrefslogtreecommitdiffstats
path: root/examples/wayland/minimal-cpp/compositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/wayland/minimal-cpp/compositor.cpp')
-rw-r--r--examples/wayland/minimal-cpp/compositor.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/examples/wayland/minimal-cpp/compositor.cpp b/examples/wayland/minimal-cpp/compositor.cpp
index ea685923b..5e46895c4 100644
--- a/examples/wayland/minimal-cpp/compositor.cpp
+++ b/examples/wayland/minimal-cpp/compositor.cpp
@@ -44,17 +44,9 @@
#include <QtWaylandCompositor/qwaylandoutput.h>
#include <QOpenGLFunctions>
-GLuint View::getTexture() {
- if (advance()) {
- QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions();
- if (m_texture)
- functions->glDeleteTextures(1, &m_texture);
-
- functions->glGenTextures(1, &m_texture);
- functions->glBindTexture(GL_TEXTURE_2D, m_texture);
- functions->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- currentBuffer().bindToTexture();
- }
+QOpenGLTexture *View::getTexture() {
+ if (advance())
+ m_texture = currentBuffer().toOpenGLTexture();
return m_texture;
}