Qt World Summit: Submit your Presentation

QtOpenGL ES 2.0 and QGLPixelBuffer

  • I use this line in the constructor of a QGLWidget when compiling for maemo5:
    @pbuffer = new QGLPixelBuffer(QSize(1024, 1024), format(), this);@
    and that gives me this error:
    @QGLPixelBufferPrivate::init(): Unable to create EGL pbuffer surface: "Bad match (0x3009)" @
    This is not a problem when compiling for desktop target..
    What's the problem here ?

    Edit: I just found out that pbuffer's are not supported on the platform. I want to render into a QImage, is there any other solutions to this ?

  • I solved it this way:
    @ QImage res = QImage(320, 320, QImage::Format_ARGB32);
    glReadPixels(0, 0, 320, 320, GL_RGBA, GL_UNSIGNED_BYTE, res.bits());
    // OpenGL gives ABGR (i.e. RGBA backwards); Qt wants ARGB
    res = res.rgbSwapped();@

Log in to reply