eglMakeCurrent(mDisplay->eglDisplay(), 0, 0, mBuffer->mContext);
glBindFramebuffer(GL_FRAMEBUFFER, mBuffer->mFbo);
- glBindRenderbuffer(GL_RENDERBUFFER, mBuffer->mRbo);
- glEGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, mBuffer->mImage);
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
- GL_RENDERBUFFER, mBuffer->mRbo);
+ glBindTexture(GL_TEXTURE_2D, mBuffer->mTexture);
+ glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, mBuffer->mImage);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_TEXTURE_2D, mBuffer->mTexture, 0);
}
void QWaylandGLContext::doneCurrent()
imageAttribs[3] = size.height();
mImage = eglCreateDRMImageMESA(mDisplay->eglDisplay(), imageAttribs);
glGenFramebuffers(1, &mFbo);
- glGenRenderbuffers(1, &mRbo);
glGenTextures(1, &mTexture);
glBindTexture(GL_TEXTURE_2D, mTexture);
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage);
QWaylandDrmBuffer::~QWaylandDrmBuffer(void)
{
glDeleteFramebuffers(1, &mFbo);
- glDeleteRenderbuffers(1, &mRbo);
glDeleteTextures(1, &mTexture);
eglDestroyImageKHR(mDisplay->eglDisplay(), mImage);
wl_buffer_destroy(mBuffer);