lv_opengles_pbuffer.h
API reference for lv_opengles_pbuffer.h
Functions
lv_opengles_pbuffer_get_gles_version
Get the OpenGL ES major version of the context backing a pbuffer display. ES3 is requested first, but drivers that cannot provide it fall back to ES2, where features needing ES3 shaders (e.g. glTF) are unavailable.
uint8_t lv_opengles_pbuffer_get_gles_version(lv_display_t *display)| Name | Type | Description |
|---|---|---|
display | lv_display_t * | a display created by lv_opengles_pbuffer_create |
Returns: uint8_t — 3 or 2, or 0 if display is not a pbuffer display
lv_opengles_pbuffer_get_handle
Get the pbuffer handle of a display, so it can be torn down after the display itself is gone. See lv_opengles_pbuffer_destroy.
lv_opengles_pbuffer_t * lv_opengles_pbuffer_get_handle(lv_display_t *display)| Name | Type | Description |
|---|---|---|
display | lv_display_t * | a display created by lv_opengles_pbuffer_create |
Returns: lv_opengles_pbuffer_t * — the handle, or NULL if display is not a pbuffer display
lv_opengles_pbuffer_create
Create a display that renders off-screen into an EGL pbuffer and reads the result back into its draw buffer, so no window system is needed.
The resolution and color format are fixed at creation; changing either on the returned display is not supported.
lv_display_t * lv_opengles_pbuffer_create(int32_t hor_res, int32_t ver_res)| Name | Type | Description |
|---|---|---|
hor_res | int32_t | horizontal resolution in pixels |
ver_res | int32_t | vertical resolution in pixels |
Returns: lv_display_t * — the new display, or NULL on failure
lv_opengles_pbuffer_read_to_draw_buf
Read the pbuffer display's current framebuffer contents into a draw buffer. Called automatically when the display is flushed; use it directly only to take an extra copy. The draw buffer must match the display resolution.
lv_result_t lv_opengles_pbuffer_read_to_draw_buf(lv_display_t *display, lv_draw_buf_t *draw_buf)| Name | Type | Description |
|---|---|---|
display | lv_display_t * | a display created by lv_opengles_pbuffer_create |
draw_buf | lv_draw_buf_t * | the draw buffer to read the pixels into |
Returns: lv_result_t — LV_RESULT_OK on success, LV_RESULT_INVALID on error
lv_opengles_pbuffer_destroy
Destroy a pbuffer context, releasing its GL objects and the EGL context.
This is deliberately not done when the display is deleted. Draw units may still run GL calls while they are being destroyed, and lv_deinit() deletes displays before draw units, so tearing the EGL context down from the display's delete event would pull the context out from under them. Fetch the handle with lv_opengles_pbuffer_get_handle() beforehand and call this afterwards.
void lv_opengles_pbuffer_destroy(lv_opengles_pbuffer_t *pbuffer)| Name | Type | Description |
|---|---|---|
pbuffer | lv_opengles_pbuffer_t * | handle from lv_opengles_pbuffer_get_handle, NULL is ignored |
Typedefs
lv_opengles_pbuffer_t
typedef struct _lv_opengles_pbuffer lv_opengles_pbuffer_tAn off-screen EGL pbuffer context and its render target
Used by 1 function
lv_opengles_pbuffer_destroy— parampbuffer
Dependencies
lvgl_public.h
Last updated on