From 7f34bb8620d99cc72454c1e14a1556c7e8a77343 Mon Sep 17 00:00:00 2001 From: Shengwen Cheng Date: Fri, 2 Aug 2024 21:27:14 +0800 Subject: [PATCH] Mention sample program execution with Linux framebuffer and input system --- README.md | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 99bcb50..1917b93 100644 --- a/README.md +++ b/README.md @@ -60,31 +60,56 @@ benefiting the entire application stack. ## Build and Verify +### Prerequisites + `Mado` is built with a minimalist design in mind. However, its verification relies on certain third-party packages for full functionality and access to all -its features. To ensure proper operation, the development environment should -have the [SDL2 library](https://www.libsdl.org/), [libjpeg](https://www.ijg.org/), and [libpng](https://github.com/pnggroup/libpng) installed. +its features. We encourage the development environment to be installed with all optional +packages, including [libjpeg](https://www.ijg.org/), [libpng](https://github.com/pnggroup/libpng), +and the [SDL2 library](https://www.libsdl.org/). * macOS: `brew install sdl2 jpeg libpng` * Ubuntu Linux / Debian: `sudo apt install libsdl2-dev libjpeg-dev libpng-dev` -Configure via [Kconfiglib](https://pypi.org/project/kconfiglib/) +### Configure the demo program + +Configure via [Kconfiglib](https://pypi.org/project/kconfiglib/), you should select either SDL +video output or the Linux framebuffer. ```shell $ make config ``` -Build the library and demo program. +### Build the library and demo program + ```shell $ make ``` -Run sample `Mado` program: +### Run demo program with SDL backend + ```shell $ ./demo-sdl ``` Once the window appears, you should be able to move the windows and interact with the widgets. +### Run demo program with the Linux framebuffer backend + +Normal users don't have access to `/dev/fb0` so use `sudo`: + +```shell +$ sudo ./demo-fbdev +``` + +Alternatively, you can add the user to the video group to avoid typing `sudo` every time: + +```shell +$ sudo usermod -a -G video $USERNAME +``` + +In addition, the framebuffer and mouse device files can be assigned via environment variable `$FRAMEBUFFER` and `$MOUSE`. + ## License `Mado` is available under a MIT-style license, permitting liberal commercial use. Use of this source code is governed by a MIT license that can be found in the [LICENSE](LICENSE) file. +