diff options
Diffstat (limited to 'include/yasl/yasl.h')
| -rw-r--r-- | include/yasl/yasl.h | 12 |
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; }; |
