To render to an EGLDevice through stream

  1. Query EGL extensions using eglGetProcAddress.
  2. Query available EGLDevices with eglQueryDevicesEXT.
  3. Obtain an EGL display from the EGL device using eglGetPlatformDisplayEXT.

    This step creates an EGLDisplay that does not belong to any native platform.

  4. Initialize/setup EGL using eglInitialize.
  5. Setup an EGLOutput. For detailed steps, see Setting Up the Display.
    • Selecting an output:
      • Can be done by enumerating all outputs and selecting a known index.
      • Can be done by looking up an output associated with a native (e.g. DRM) screen handle.
    • If necessary, initialize display settings using native interfaces
  6. Direct rendering to an EGLOutput.
    • Create an EGL stream using eglCreateStreamKHR.
    • Connect the output layer to the stream. Bind consumer end of stream to EGLOutput window object using eglStreamConsumerOutputEXT.
  7. Set buffer configurations by choosing an EGLConfig
  8. Create a stream producer surface to feed the stream using eglCreateStreamProducerSurfaceKHR.
  9. Create an EGL context, make it current by binding it to the stream surface using eglMakeCurrent.
  10. Post surface contents to the stream using eglSwapBuffers.