LVGL For Opensuse Linux 模拟器(VSCode+SDL2)

SDL2 运行环境和源码依赖库

# 搜索
sudo zypper se libsdl2
# 根据搜索结果和教程安装
sudo zypper in libSDL2-2_0-0 lidSDL2-devel

同步 VSCode+SDL 模拟器项目

这是一个用SDL2模拟嵌入式设备触摸显示屏的基础项目,也就是说底层渲染函数是用SDL2实现好了的,方便我们在PC上调试使用。项目在PC上开发得差不多再移植到嵌入式设备上。SDL a low level driver library to use graphics, handle mouse, keyboard etc. 详见:https://github.com/lvgl/lv_sim_vscode_sdl

## 拉取
git clone https://github.com/lvgl/lv_sim_vscode_sdl.git --depth=1  --recursive
## 更新(如有需要
cd lv_sim_vscode_sdl
git pull --recurse-submodules

加速Clone

see: https://gitclone.com/
如果clone不动,那你就烧香给方校长,然后将github.com 换为github.com.cnpmjs.org即可实现加速,操作如下
https://zhuanlan.zhihu.com/p/361136073

还有一种,未验证

# 烧香给方校长,深深地感谢他,然后进入所在仓库目录
cd lv_sim_vscode_sdl/
# 然后以下两条命令任选一条
git config url."https://gitclone.com/github.com/".insteadOf https://github.com/
# 或者
git config url."https://github.com.cnpmjs.org".insteadOf https://github.com/

然后VSCode (自己装好c环境插件,不懂可看我另一篇文章)打开该项目即可
按下F5调试启动主程序
image
默认是启动例子lv_demo_widgets();
image

开发

https://lvgl.io/
控件例子
https://docs.lvgl.io/master/examples.html#get-started
例子APP源码
example的主程序,如lv_examples/src/lv_demo_music/lv_demo_music.c

--------蓝天上的云_转载请注明出处.
原文地址:https://www.cnblogs.com/yucloud/p/LVGL_SDL2_VSCode.html