Only keep SDL2 support. Left the other flags commented so that people can tweak it.

Updated Readme.md for instructions.
This commit is contained in:
Xiaosheng An 2023-10-03 12:59:02 +01:00
parent b255c84632
commit 47f95e396c
4 changed files with 43 additions and 14 deletions

View File

@ -29,8 +29,8 @@ CFLAGS := -O0 -g $(WARNINGS)
DEFINES := -D SIMULATOR=1 -D LV_BUILD_TEST=0
# Include simulator inc folder first so lv_conf.h from custom UI can be used instead
INC := -I./ui/simulator/inc/ -I./ -I./lvgl/ -I/usr/include/freetype2 -L/usr/local/lib
LDLIBS := -lSDL2 -lm -lfreetype -lavformat -lavcodec -lavutil -lswscale -lm -lz -lpthread
INC := -I./ui/simulator/inc/ -I./ -I./lvgl/ #-I/usr/include/freetype2 -L/usr/local/lib
LDLIBS := -lSDL2 -lm #-lfreetype -lavformat -lavcodec -lavutil -lswscale -lm -lz -lpthread
BIN := $(BIN_DIR)/demo
COMPILE = $(CC) $(CFLAGS) $(INC) $(DEFINES)

View File

@ -21,7 +21,7 @@ To allow debugging inside VSCode you will also require a GDB [extension](https:/
Clone the PC project and the related sub modules:
```
```bash
git clone --recursive https://github.com/lvgl/lv_port_pc_vscode
```
@ -29,10 +29,38 @@ git clone --recursive https://github.com/lvgl/lv_port_pc_vscode
You can download SDL from https://www.libsdl.org/
On on Linux you can install it via terminal:
```
```bash
sudo apt-get update && sudo apt-get install -y build-essential libsdl2-dev
```
### Optional library
There are also FreeType and FFmpeg support. You can install FreeType support with:
```bash
# FreeType support
wget https://kumisystems.dl.sourceforge.net/project/freetype/freetype2/2.13.2/freetype-2.13.2.tar.xz
tar -xf freetype-2.13.2.tar.xz
cd freetype-2.13.2
make
make install
```
The FFmpeg support can be installed with:
```bash
# FFmpeg support
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
git checkout release/6.0
./configure --disable-all --disable-autodetect --disable-podpages --disable-asm --enable-avcodec --enable-avformat --enable-decoders --enable-encoders --enable-demuxers --enable-parsers --enable-protocol='file' --enable-swscale --enable-zlib
make
sudo make install
```
And then remove all the comments in the `Makefile` on `INC` and `LDLIBS` lines. They should be:
```Makefile
INC := -I./ui/simulator/inc/ -I./ -I./lvgl/ -I/usr/include/freetype2 -L/usr/local/lib
LDLIBS := -lSDL2 -lm -lfreetype -lavformat -lavcodec -lavutil -lswscale -lm -lz -lpthread
```
### Setup
To allow custom UI code an `lv_conf.h` file placed at `ui/simulator/inc` will automatically override this projects lv_conf.h file. By default code under `ui` is ignored so you can reuse this repository for multiple projects. You will need to place a call from `main.c` to your UI's entry function.

View File

@ -536,23 +536,23 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
#endif
/*PNG decoder library*/
#define LV_USE_PNG 1
#define LV_USE_PNG 0
/*BMP decoder library*/
#define LV_USE_BMP 1
#define LV_USE_BMP 0
/* JPG + split JPG decoder library.
* Split JPG is a custom format optimized for embedded systems. */
#define LV_USE_SJPG 1
#define LV_USE_SJPG 0
/*GIF decoder library*/
#define LV_USE_GIF 1
#define LV_USE_GIF 0
/*QR code library*/
#define LV_USE_QRCODE 1
#define LV_USE_QRCODE 0
/*FreeType library*/
#define LV_USE_FREETYPE 1
#define LV_USE_FREETYPE 0
#if LV_USE_FREETYPE
/*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/
#define LV_FREETYPE_CACHE_SIZE (16 * 1024)
@ -573,7 +573,7 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
/*FFmpeg library for image decoding and playing videos
*Supports all major image formats so do not enable other image decoder with it*/
#define LV_USE_FFMPEG 1
#define LV_USE_FFMPEG 0
#if LV_USE_FFMPEG
/*Dump input information to stderr*/
#define LV_FFMPEG_DUMP_FORMAT 0

View File

@ -66,7 +66,7 @@ static int tick_thread(void *data);
/**********************
* GLOBAL FUNCTIONS
**********************/
#if 0
static void user_image_demo()
{
lv_obj_t * img = lv_gif_create(lv_scr_act());
@ -151,6 +151,7 @@ static void user_image_demo()
lv_ffmpeg_player_set_cmd(player, LV_FFMPEG_PLAYER_CMD_START);
lv_obj_align(player, LV_ALIGN_TOP_MID, 0, 20);
}
#endif
int main(int argc, char **argv)
{
@ -181,13 +182,13 @@ int main(int argc, char **argv)
// lv_example_flex_3();
// lv_example_label_1();
// lv_demo_widgets();
lv_demo_widgets();
// lv_demo_keypad_encoder();
// lv_demo_benchmark();
// lv_demo_stress();
// lv_demo_music();
user_image_demo();
// user_image_demo();
while(1) {
/* Periodically call the lv_task handler.