EGL

EGL is the platform layer that binds OpenGL ES to a native windowing system. In LVGL it underpins the hardware-accelerated backends of the DRM, Wayland and SDL drivers, and can also render off-screen with no display server at all.

Edit on GitHub

Overview

EGL (Embedded-System Graphics Library) is the platform layer that binds OpenGL ES to a native windowing system. It sits lower than GLFW and is more closely tied to the platform's own drivers, which is why it is the path LVGL uses for GPU rendering on embedded Linux.

You rarely enable EGL on its own. It underpins the hardware-accelerated backends of the other drivers:

  • DRM with LV_LINUX_DRM_BACKEND_EGL
  • Wayland with LV_WAYLAND_USE_EGL
  • SDL with LV_SDL_BACKEND_EGL

Selecting any of those backends turns EGL on for you and sets up the context during normal driver initialization. Beyond that, EGL offers two things the other drivers do not: a standalone window path for platforms LVGL does not otherwise cover, and off-screen rendering with no display server at all.

Building

LVGL loads libEGL.so and libGLESv2.so at runtime with dlopen, so EGL doesn't have any build-time dependencies.

EGL and GLFW are mutually exclusive

LV_USE_GLFW cannot be combined with LV_USE_EGL each wants to own context creation.

Usage

With a driver backend, EGL is invisible: configure the driver as its own page describes and it initializes EGL during setup. See DRM or Wayland for working examples.

See Also

  • DRM - EGL backend for direct-to-display rendering
  • Wayland - EGL backend under a compositor
  • OpenGL Driver - use when you already own the context
  • OpenGL Overview - how the drivers and draw units fit together
  • NanoVG Draw Unit - the renderer used for off-screen rendering
  • glTF - 3D content, the strongest case for headless GPU rendering

Last updated on

On this page