lvgl / lv_drivers

TFT and touch pad drivers for LVGL embedded GUI library
https://docs.lvgl.io/master/porting/index.html
MIT License
306 stars 314 forks source link

fix(sdl) update monitor texture pointer during resize #172

Closed ReimuNotMoe closed 3 years ago

ReimuNotMoe commented 3 years ago

Texture pointer in monitor struct should be updated during SDL window resize, otherwise the old texture pointer will still be in use and result in invalid memory accesses.

embeddedt commented 3 years ago

This seems like a good fix to me. @mariotaku do you also agree?

mariotaku commented 3 years ago

Indeed. Not sure if we should do anything to old texture pointer though.

ReimuNotMoe commented 3 years ago

I want to add some more improvements to enable the end user to access SDL contexts, handle more SDL events, etc. These are necessary to:

So is including SDL headers allowed in sdl_gpu.h?

mariotaku commented 3 years ago

IMO for advanced configuration, we can ask users to create their own window and renderer, and configure the disp driver by themselves. That how I did in my project: https://github.com/mariotaku/moonlight-tv/tree/main/app/lvgl

Handle display resize: https://github.com/mariotaku/moonlight-tv/blob/main/app/lvgl/lv_disp_drv_app.c IME support: https://github.com/mariotaku/moonlight-tv/blob/main/app/lvgl/lv_sdl_drv_key_input.c (CJK input is perfectly fine)

ReimuNotMoe commented 3 years ago

Thanks you for the suggestions. I won't make more changes. You can merge the existing two commits if you want.

mariotaku commented 3 years ago

LGTM!

embeddedt commented 3 years ago

Thank you; merged.