Skip to content

Commit

Permalink
Mention sample program execution with Linux framebuffer in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shengwen-tw committed Aug 1, 2024
1 parent 262e164 commit 7497a2e
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,12 @@ software by allowing anti-aliased drawing to generate nearly invisible errors
instead of visibly incorrect results. Smooth color gradations eliminate the need
for dithering or other color-approximating schemes.

`Mado` is designed to ensure respectable CPU performance, which mitigates the
need for caching intermediate rendering results like glyph images for text. It
supports only a single, general performance class of drawing operations,
focusing exclusively on anti-aliased drawing. This focus is practical because
the CPUs that `Mado` supports are sufficiently fast, rendering non-anti-aliased
drawing obsolete. Moreover, `Mado` avoids reliance on a floating point unit (FPU)
or extensive FPU emulation by employing its own fixed-point arithmetic for all
necessary computations. This approach extends to nearly all of `Mado`'s optional
components as well. For specific tasks such as subpixel font layout and alpha
blending, `Mado` utilizes fixed-point math, ensuring that it remains efficient
even on CPUs without an FPU.
Respectable CPU performance is expected, reducing the need to cache intermediate
rendering results, such as glyph images for text. Supporting only one general
performance class of drawing operations, `Mado` focuses on anti-aliased drawing,
as supported CPUs are fast enough to make non-anti-aliased drawing irrelevant.
Additionally, `Mado` does not rely on an FPU or heavy FPU emulations, using its
own fixed-point arithmetic instead.

These environmental limitations enable `Mado` to provide significant
functionality with minimal wasted code. Unlike window systems designed for
Expand All @@ -63,11 +58,14 @@ benefiting the entire application stack.
`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.
have the [libjpeg](https://www.ijg.org/), and [libpng](https://github.com/pnggroup/libpng) installed.
The [SDL2 library](https://www.libsdl.org/) is optional and only needed if you chooses to use SDL as
the backend over the Linux framebuffer.
* 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 via [Kconfiglib](https://pypi.org/project/kconfiglib/), you should select either SDL
video output or the Linux framebuffer.
```shell
$ make config
```
Expand All @@ -77,13 +75,20 @@ Build the library and demo program.
$ make
```

Run sample `Mado` program:
Run sample `Mado` 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 sample `Mado` program with the Linux framebuffer backend:
```shell
$ sudo FRAMEBUFFER=/dev/fb0 MOUSE=/dev/input/mice ./demo-fbdev
```

Note that 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.
Expand Down

0 comments on commit 7497a2e

Please sign in to comment.