summaryrefslogtreecommitdiff
path: root/docs/getting-started.md
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 21:23:03 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 21:23:03 +0300
commitdd1775a9927922c14f8679ccbc4d3ca8d5917e20 (patch)
tree3acc442bb4a3470364b74aa82ff67cb84d555c45 /docs/getting-started.md
parentecb81aeea4c0c880b3a60a0dc8418c4bf2a7cf85 (diff)
public api refactor
Diffstat (limited to 'docs/getting-started.md')
-rw-r--r--docs/getting-started.md21
1 files changed, 11 insertions, 10 deletions
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 5e569fe..d1f284d 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -50,20 +50,20 @@ pressure, erasers, resizing, and scale changes.
## Link an application
-Install the shared and static libraries into your chosen prefix. Headers,
-examples, documentation, and pkg-config metadata remain in the source tree:
+Install the libraries, public headers, and pkg-config metadata into your prefix:
```sh
meson setup build --prefix=/usr/local --libdir=lib
meson compile -C build
meson install -C build
-cc -std=c23 -Iinclude examples/hello.c -o hello -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lyasl
+cc -std=c23 examples/hello.c -o hello $(pkg-config --cflags --libs yasl)
./hello
```
-The prefix must be writable. Use matching headers from `include/`, and adjust
-the library search path and runtime path for your chosen prefix and `libdir`.
-Static consumers must also link the enabled backends' dependencies.
+The prefix must be writable. For a custom prefix, add its pkg-config directory
+to `PKG_CONFIG_PATH` and its library directory to the runtime loader path.
+Use `pkg-config --static --libs yasl` for static consumers so backend dependencies
+are included. Installed native accessor headers match the built backends.
A Meson application can instead vendor the source under `subprojects/yasl`:
@@ -75,7 +75,7 @@ executable('my-app', 'main.c', dependencies: yasl)
The subproject dependency includes headers and backend link dependencies.
Public headers can be included from C++11 or newer; the library itself builds
-as C23. Only the library artifacts are installed by `meson install`.
+as C23. The libraries, public headers, and pkg-config metadata are installed together.
## The application cycle
@@ -84,9 +84,10 @@ as C23. Only the library artifacts are installed by `meson install`.
2. In `init`, create a toplevel with a positive **logical-pixel** size and call
`yasl_surface_request_frame(surface)` for the first redraw.
3. In `event`, handle the union member selected by `event->type`. Return
- `YASL_APP_QUIT` for a close request; otherwise return `YASL_APP_CONTINUE`.
-4. In `frame`, fill every pixel in `frame->cpu.pixels` with premultiplied
- `0xAARRGGBB` and present once with `yasl_frame_present_cpu(frame, NULL, 0)`.
+ `YASL_APP_QUIT` for a close request, `YASL_APP_ERROR` for failure, or
+ `YASL_APP_CONTINUE` to keep running.
+4. In `frame`, fill every pixel in `frame->target.pixels` with premultiplied
+ `0xAARRGGBB` and present once with `yasl_frame_present(frame, NULL, 0)`.
5. Let the runner close remaining surfaces and the display. Release your own
resources in the optional `quit` callback or after `yasl_run()` returns.