Results 1 to 2 of 2

Thread: Can eglCreateWindowSurface be used for off-screen rendering?

  1. #1

    Can eglCreateWindowSurface be used for off-screen rendering?

    Hello,

    we're are wondering if eglCreateWindowSurface can be used for off-screen rendering and benefit from the eglSwapBuffers function instead of using the time consuming function glReadPixels.
    Or should we only use eglCreatePbufferSurface which we know is made for off-screen rendering?

    Thanks,

    Tanguy
    Last edited by Wonderketchup; 11-21-2016 at 03:36 AM.

  2. #2
    Junior Member
    Join Date
    Feb 2012
    Posts
    6
    Hi,
    When you use eglCreateWindowSurface, the buffers are generally ownership of the window system and part of the "window". The only way to get to the pixels is to use glReadPixels or use eglLockSurface and query for the buffer and all the attributes that describe its memory layout. But that is not always supported.

    eglCreatePbufferSurface was intended for use of offscreen rendering - specifically EGL owns the buffer. However, since the addition of GL/GLES Renderbuffers objects these can be more efficient and have all the same features.

    If access to the pixels is paramount, and your driver supports it, creating an EGLImage using eglCreateImage you either provide or have access to a texture, made from the image, or image made from texture, that can be used with a Framebufferobject. Then you can access the pixels of the image - provided you understand the memory layout of the pixels/buffer.

    Hope that covers your use case.
    Jeff

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean