Open sliang951753 opened 4 months ago
I started to work on completing the SDL renderer here: https://github.com/lvgl/lvgl/pull/6437
If LV_USE_DRAW_SDL option is enabled, it will cause the redefinition error because the macro LV_USE_DRAW_SDL already be defined in lv_conf.h file.
If you enable this option via CMake, you can remove LV_USE_DRAW_SDL
from lv_conf.h
If using sdl draw unit to run the widget demo, all images cannot be displayed. The console will continuously output the error "could not load image: SDL_RWFromFile(): No file or no mode specified"
I'll resolve it in https://github.com/lvgl/lvgl/pull/6437
Please help to check the RGB mask value in draw image task of SDL draw unit. I saw currently only 32bit color can work. For other color format (such as rgb565),the SDL will report color mask error.
Is it with LVGL v8 or v9?
Is it with LVGL v8 or v9?
v9
I've tried the lv_demo_widgets()
with LV_COLOR_DEPTH 16
and lvgl
master
. It worked well for me.
Have you installed libsdl2-image-dev
?
The problem is when the bpp of an image is not 32. for example, bpp = 16, then the R mask is 0x001F instead of 0x000000FF If you pass 0x000000FF to the SDL_CreateRGBSurfaceFrom function, it will report "Unknown pixel format " error. This can be reproduced by running the benchmark. For demo widgets, its ok.
Oh I see. I can't see just a dirty fix to resolve it, however https://github.com/lvgl/lvgl/pull/6437 should fix it.
There's two issues when using LV_USE_DRAW_SDL option in cmake.