summaryrefslogtreecommitdiff
path: root/README.md
blob: d486b800420be9427eb60ae2add47878ca441b4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# YASL — Yet Another Surface Library

YASL is a small C desktop surface and input library for applications that own
their event loop and renderer. It supports Wayland, X11, and Cocoa, with CPU
images, optional OpenGL contexts, Vulkan window surfaces, and direct Metal layers.
Pen input includes tool identity, proximity/contact, pressure, tilt, and available
rotation/distance/tangential/wheel axes. It also supplies IME composition/editing,
clipboard text, popups, file drops, and surface drags.

The first surface initializes a shared backend. Surface operations use ordinary
arguments; there are no public display objects, creation descriptors, frame
objects, point/size/string wrappers, or mandatory application runner.

```c
yasl_surface *surface = yasl_surface_create("Example", 800, 600, 0);
```

Flags zero creates a GPU window without choosing a graphics API. The application
attaches a Vulkan surface or Metal layer, or uses `yasl_gl_surface_create` to create
an OpenGL window/context. `YASL_SURFACE_CPU` gives the window a pixel buffer: draw into
`yasl_cpu_pixels` and call `yasl_cpu_present`. Native handles are available through typed extension headers.

**Status:** pre-release 0.1; source and ABI compatibility are not promised.
Use matching headers and library. Supported operations depend on the backend,
server, and optional dependencies; check results and `yasl_get_error`.

Build with a C23 compiler, Meson 1.6+, and Ninja:

```sh
meson setup build
meson compile -C build
./build/yasl-hello
meson test -C build --print-errorlogs
```

Linux needs Wayland or X11 development packages; EGL and wayland-egl enable GL,
and the Vulkan SDK enables its typed bridge. Cocoa needs macOS 14+ and its SDK.

- [Getting started](docs/getting-started.md): creation, linking, and rendering.
- [Application guide](docs/guide.md): ownership, events, GPUs, pen, and backend limits.
- [Testing](docs/testing.md): unit tests and isolated GPU/backend tests.
- [API policy](docs/api-policy.md) and [contributing](CONTRIBUTING.md).
- Public headers live in [include/yasl](include/yasl); examples live in [examples](examples).

MIT licensed; see [LICENSE](LICENSE).