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.
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:
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
OpenGL Driver
The OpenGL driver renders an LVGL display into an OpenGL texture, for embedding LVGL inside an application that already owns the OpenGL context.
evdev
The evdev driver reads touchscreen, mouse and keyboard input straight from Linux /dev/input event devices, with no user-space input library required.