#include "backend.h" #include void *yasl_display_get_native_handle(struct yasl_display *d) { if (!d) return NULL; if (d->native_handle) return d->native_handle; return d->ops && d->ops->display_get_native_handle ? d->ops->display_get_native_handle(d) : NULL; } void *yasl_surface_get_native_handle(struct yasl_surface *s) { if (!s) return NULL; if (s->native_handle) return s->native_handle; return s->display && s->display->ops && s->display->ops->surface_get_native_handle ? s->display->ops->surface_get_native_handle(s) : NULL; } struct yasl_surface *yasl_surface_create_native(struct yasl_display *d, const struct yasl_window_spec *spec, void *graphics_device) { if (!graphics_device) { errno = EINVAL; return NULL; } return yasl_create_toplevel(d, spec, graphics_device); } bool yasl_surface_get_native_frame(struct yasl_surface *s, const struct yasl_framebuffer *target, struct yasl_native_frame *out) { if (!s || !target || !out || !target->generation || target->generation != s->frame_generation || !s->display->ops->surface_get_native_frame) return false; return s->display->ops->surface_get_native_frame(s, target, out); }