summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorgen Lind <jorgen.lind@digia.com>2014-03-10 09:25:36 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-11 15:35:00 +0100
commita9d9fa463cd6b915fd4fda7e06317b5299c893e7 (patch)
tree29620c8d45efce0e22659463505bae3a11574fdb
parenteeb365a8f164a1402c19ca5a7e38e01f4e69cf7b (diff)
downloadqtwayland-a9d9fa463cd6b915fd4fda7e06317b5299c893e7.tar.gz
qtwayland-a9d9fa463cd6b915fd4fda7e06317b5299c893e7.tar.bz2
qtwayland-a9d9fa463cd6b915fd4fda7e06317b5299c893e7.zip
Compile ServerBuffer client example on desktop gl
Change-Id: I8efbda3e5266c5668b2461429a21d900e2ecd175 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
-rw-r--r--examples/server-buffer/client/main.cpp4
-rw-r--r--examples/server-buffer/client/serverbufferrenderer.cpp4
-rw-r--r--examples/server-buffer/client/serverbufferrenderer.h4
3 files changed, 7 insertions, 5 deletions
diff --git a/examples/server-buffer/client/main.cpp b/examples/server-buffer/client/main.cpp
index 1880f216..ce705b6a 100644
--- a/examples/server-buffer/client/main.cpp
+++ b/examples/server-buffer/client/main.cpp
@@ -112,8 +112,8 @@ public slots:
}
m_context->makeCurrent(this);
-
- glBindFramebuffer(GL_FRAMEBUFFER, m_context->defaultFramebufferObject());
+ QOpenGLFunctions *funcs = m_context->functions();
+ funcs->glBindFramebuffer(GL_FRAMEBUFFER, m_context->defaultFramebufferObject());
glViewport(0, 0, width() * devicePixelRatio(), height() * devicePixelRatio());
glClearColor(0.f, 0.f, 0.0f, 1.f);
diff --git a/examples/server-buffer/client/serverbufferrenderer.cpp b/examples/server-buffer/client/serverbufferrenderer.cpp
index 9eafddd6..2f0d204d 100644
--- a/examples/server-buffer/client/serverbufferrenderer.cpp
+++ b/examples/server-buffer/client/serverbufferrenderer.cpp
@@ -42,6 +42,7 @@
#include <QtGui/QOpenGLVertexArrayObject>
#include <QtGui/QOpenGLShaderProgram>
+
static const GLfloat uv_coords[] = {
0,0,
0,1,
@@ -74,7 +75,8 @@ static const char fragment_shader[] =
"}";
ServerBufferRenderer::ServerBufferRenderer(QWaylandServerBuffer *serverBuffer)
- : m_server_buffer(serverBuffer)
+ : QOpenGLFunctions(QOpenGLContext::currentContext())
+ , m_server_buffer(serverBuffer)
, m_texture(0)
, m_vao(new QOpenGLVertexArrayObject())
, m_program(new QOpenGLShaderProgram())
diff --git a/examples/server-buffer/client/serverbufferrenderer.h b/examples/server-buffer/client/serverbufferrenderer.h
index 58f0c704..7e8999b1 100644
--- a/examples/server-buffer/client/serverbufferrenderer.h
+++ b/examples/server-buffer/client/serverbufferrenderer.h
@@ -42,14 +42,14 @@
#define SERVERBUFFERRENDERER_H
#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
-
+#include <QtGui/QOpenGLFunctions>
#include <QMatrix4x4>
QT_BEGIN_NAMESPACE
class QOpenGLVertexArrayObject;
class QOpenGLShaderProgram;
-class ServerBufferRenderer
+class ServerBufferRenderer : public QOpenGLFunctions
{
public:
ServerBufferRenderer(QWaylandServerBuffer *serverBuffer);