treewide: add Wayland and SDL2 backends

This commit is contained in:
Dylan Van Assche 2025-11-29 21:37:51 +01:00 committed by Johannes Marbach
parent 271cdf8534
commit e69bcf5dc2
11 changed files with 44 additions and 3 deletions

View file

@ -16,6 +16,9 @@ static const char *backends[] = {
#endif
#if LV_USE_LINUX_DRM
"drm",
#endif
#if LV_USE_SDL
"sdl",
#endif
NULL
};

View file

@ -9,7 +9,7 @@
#include "lv_conf.h"
#if LV_USE_LINUX_FBDEV == 0 && LV_USE_LINUX_DRM == 0
#if LV_USE_LINUX_FBDEV == 0 && LV_USE_LINUX_DRM == 0 && LV_USE_SDL == 0
#error Neither of graphical backends is enabled
#endif
@ -26,6 +26,9 @@ typedef enum {
#if LV_USE_LINUX_DRM
BBX_BACKENDS_BACKEND_DRM,
#endif
#if LV_USE_SDL
BBX_BACKENDS_BACKEND_SDL,
#endif
} bbx_backends_backend_id_t;
/**

View file

@ -63,6 +63,17 @@ lv_display_t *bbx_display_create(bbx_backends_backend_id_t backend_id, bbx_displ
break;
#endif /* LV_USE_LINUX_DRM */
#if LV_USE_SDL
case BBX_BACKENDS_BACKEND_SDL:
bbx_log(BBX_LOG_LEVEL_VERBOSE, "Using SDL2 backend");
disp = lv_sdl_window_create(config->hor_res > 0 ? config->hor_res: 800, config->ver_res > 0 ? config->ver_res: 480);
if (!disp) {
bbx_log(BBX_LOG_LEVEL_ERROR, "Failed to create SDL2 display");
return NULL;
}
break;
#endif /* LV_USE_SDL */
default:
bbx_log(BBX_LOG_LEVEL_ERROR, "Unable to find suitable backend");
return NULL;