diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-11 23:51:43 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-11 23:51:43 +0300 |
| commit | e813252e685d761235ad45e170d97c9375f51958 (patch) | |
| tree | e57bae545c0eb22aac4119a890b8344ee7cd09d2 /include/yasl/yasl.h | |
| parent | 608b49052178ea74f593c925cdeedf352aa1c357 (diff) | |
| parent | 6eac0a5f2c552728efca420b1129fae7d4fea773 (diff) | |
Merge branch 'backend-selection' into main
- Implement runtime backend selection (Wayland, X11, Cocoa)
- Add native X11 backend with clipboard, keyboard, mouse, and placement
- Integrate multi-backend integration tests running under Weston and Xwayland
- Retain zero-hole struct packing, branchless ALU/LUT primitives, and paced event loop
Diffstat (limited to 'include/yasl/yasl.h')
| -rw-r--r-- | include/yasl/yasl.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/yasl/yasl.h b/include/yasl/yasl.h index c211a0b..6fea487 100644 --- a/include/yasl/yasl.h +++ b/include/yasl/yasl.h @@ -259,14 +259,25 @@ struct yasl_surface_cbs { }; /* Display Lifecycle */ +enum yasl_backend { + YASL_BACKEND_AUTO = 0, + YASL_BACKEND_WAYLAND, + YASL_BACKEND_X11, + YASL_BACKEND_COCOA, +}; + struct yasl_display_spec { const char *app_id; const struct yasl_display_cbs *cbs; void *ud; + /* Zero selects the native backend. An explicit choice never falls back. */ + enum yasl_backend backend; }; +/* Return NULL and set errno if the requested backend cannot open. */ YASL_API struct yasl_display *yasl_display_open(struct yasl_loop *loop, const struct yasl_display_spec *spec); +YASL_API enum yasl_backend yasl_display_backend(const struct yasl_display *d); YASL_API void yasl_display_close(struct yasl_display *d); YASL_API uint32_t yasl_display_caps(const struct yasl_display *d); YASL_API void yasl_display_dispatch(struct yasl_display *d); @@ -287,6 +298,7 @@ struct yasl_surface_spec { struct yasl_vector2i size; bool fullscreen; bool tearing; + /* Optional native graphics device. NULL selects CPU pixel presentation. */ void *graphics_device; }; @@ -347,6 +359,7 @@ YASL_API void yasl_loop_destroy(struct yasl_loop *l); YASL_API int yasl_loop_run(struct yasl_loop *l); YASL_API int yasl_loop_step(struct yasl_loop *l, int timeout_ms); YASL_API void yasl_loop_quit(struct yasl_loop *l); +YASL_API bool yasl_loop_is_running(const struct yasl_loop *l); YASL_API void yasl_loop_kick(struct yasl_loop *l); YASL_API uint64_t yasl_loop_now_ns(void); YASL_API int yasl_loop_add_fd(struct yasl_loop *l, int fd, short events, |
