diff options
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, |
