diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 15:43:04 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 15:43:04 +0300 |
| commit | e24b8a8cef001e1c7e50ab12b739486f59b2a850 (patch) | |
| tree | f4678f9c7081c2bfd2dad56c8ca456c01447a116 /docs/guide.md | |
| parent | 38533c81e7b7ebfc5f281c2523188aeaa38d09c3 (diff) | |
Let yasl_app_desc describe its initial window
A new optional yasl_app_desc.window spec makes yasl_run() create that
toplevel and request its first frame before init(), which is now
optional too. If creation fails, yasl_run() closes the display and
returns an error without calling init().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/guide.md')
| -rw-r--r-- | docs/guide.md | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/docs/guide.md b/docs/guide.md index f195e5e..a65972f 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -40,8 +40,11 @@ it advertises CSD. Check each result and provide an application fallback. ## Window creation and callbacks All examples include `<yasl/app.h>` and call `yasl_run()` with a -`yasl_app_desc`. Create surfaces in `init`, handle `YASL_EVENT_*` notifications -in `event`, and render into `frame->cpu.pixels` in `frame`. Present with +`yasl_app_desc`. Set `window` to a `yasl_window_spec` for a single toplevel, +which the runner creates before `init` with its first frame requested; `yasl_run()` returns an +error if creation fails. Create further surfaces in the optional `init`, handle +`YASL_EVENT_*` notifications in `event`, and render into `frame->cpu.pixels` in +`frame`. Present with `yasl_frame_present_cpu(frame, NULL, 0)` and return `YASL_APP_QUIT` from an event handler to exit. The runner handles dispatch, input polling, resize redraws, and remaining surface/display cleanup. Display quit stops the runner; connection |
