summaryrefslogtreecommitdiff
path: root/include/yasl/yasl.h
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-11 23:40:57 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-11 23:40:57 +0300
commit6eac0a5f2c552728efca420b1129fae7d4fea773 (patch)
tree27fc9dc013de80787525696897771acec22c0f0c /include/yasl/yasl.h
parent8d9f7c7cb39359d62bf28ef1775b944a7dddd6fb (diff)
feat: backend selection (Wayland, X11, Cocoa)
Diffstat (limited to 'include/yasl/yasl.h')
-rw-r--r--include/yasl/yasl.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/yasl/yasl.h b/include/yasl/yasl.h
index 0c2235a..2574457 100644
--- a/include/yasl/yasl.h
+++ b/include/yasl/yasl.h
@@ -258,14 +258,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);
@@ -285,6 +296,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;
};