#include <QGLWidget>
#include <QtGui/private/qopengltexturecache_p.h>
#include "textureblitter.h"
+#include <QOpenGLFunctions>
#endif
#include <QDebug>
#ifdef QT_COMPOSITOR_WAYLAND_GL
GLuint composeSurface(WaylandSurface *surface) {
GLuint texture = 0;
+ QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions();
- if (!m_surfaceCompositorFbo) {
- glGenFramebuffers(1,&m_surfaceCompositorFbo);
- }
- glBindFramebuffer(GL_FRAMEBUFFER, m_surfaceCompositorFbo);
+ if (!m_surfaceCompositorFbo)
+ functions->glGenFramebuffers(1,&m_surfaceCompositorFbo);
+
+ functions->glBindFramebuffer(GL_FRAMEBUFFER, m_surfaceCompositorFbo);
if (surface->type() == WaylandSurface::Shm) {
texture = m_textureCache->bindTexture(context()->contextHandle(), surface->image());
} else {
texture = surface->texture(QOpenGLContext::currentContext());
}
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_TEXTURE_2D, texture, 0);
+
+ functions->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D, texture, 0);
paintChildren(surface,surface);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_TEXTURE_2D, 0, 0);
+ functions->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D, 0, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ functions->glBindFramebuffer(GL_FRAMEBUFFER, 0);
return texture;
}
#include <QMouseEvent>
#include <QKeyEvent>
#include <QTouchEvent>
+#include <QOpenGLFunctions>
#include <QtCompositor/waylandinput.h>
m_renderScheduler.setSingleShot(true);
connect(&m_renderScheduler,SIGNAL(timeout()),this,SLOT(render()));
- glGenFramebuffers(1,&m_surface_fbo);
+ QOpenGLFunctions *functions = m_window->context()->functions();
+ functions->glGenFramebuffers(1, &m_surface_fbo);
window->installEventFilter(this);
{
GLuint texture = 0;
- glBindFramebuffer(GL_FRAMEBUFFER, m_surface_fbo);
+ QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions();
+ functions->glBindFramebuffer(GL_FRAMEBUFFER, m_surface_fbo);
if (surface->type() == WaylandSurface::Shm) {
texture = m_textureCache->bindTexture(QOpenGLContext::currentContext(),surface->image());
} else {
texture = surface->texture(QOpenGLContext::currentContext());
}
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_TEXTURE_2D, texture, 0);
+
+ functions->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D, texture, 0);
paintChildren(surface,surface);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_TEXTURE_2D,0, 0);
+ functions->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D,0, 0);
- glBindFramebuffer(GL_FRAMEBUFFER,0);
+ functions->glBindFramebuffer(GL_FRAMEBUFFER, 0);
return texture;
}