union waffle_native_config* glx_config_get_native(struct wcore_config *wc_self) { struct glx_config *self = glx_config(wc_self); struct glx_display *dpy = glx_display(wc_self->display); union waffle_native_config *n_config; WCORE_CREATE_NATIVE_UNION(n_config, glx); if (!n_config) return NULL; n_config->glx->xlib_display = dpy->x11.xlib; n_config->glx->glx_fbconfig = self->glx_fbconfig; return n_config; }
static union waffle_native_context* wayland_context_get_native(struct wcore_context *wc_ctx) { struct wayland_display *dpy = wayland_display(wc_ctx->display); struct wegl_context *ctx = wegl_context(wc_ctx); union waffle_native_context *n_ctx; WCORE_CREATE_NATIVE_UNION(n_ctx, wayland); if (!n_ctx) return NULL; wayland_display_fill_native(dpy, &n_ctx->wayland->display); n_ctx->wayland->egl_context = ctx->egl; return n_ctx; }
static union waffle_native_config* wayland_config_get_native(struct wcore_config *wc_config) { struct wegl_config *config = wegl_config(wc_config); struct wayland_display *dpy = wayland_display(wc_config->display); union waffle_native_config *n_config; WCORE_CREATE_NATIVE_UNION(n_config, wayland); if (!n_config) return NULL; wayland_display_fill_native(dpy, &n_config->wayland->display); n_config->wayland->egl_config = config->egl; return n_config; }
union waffle_native_window* glx_window_get_native(struct wcore_window *wc_self) { struct glx_window *self = glx_window(wc_self); struct glx_display *dpy = glx_display(wc_self->display); union waffle_native_window *n_window; WCORE_CREATE_NATIVE_UNION(n_window, glx); if (!n_window) return NULL; n_window->glx->xlib_display = dpy->x11.xlib; n_window->glx->xlib_window = self->x11.xcb; return n_window; }
union waffle_native_window* xegl_window_get_native(struct wcore_window *wc_self) { struct xegl_window *self = xegl_window(wc_self); struct xegl_display *dpy = xegl_display(wc_self->display); union waffle_native_window *n_window; WCORE_CREATE_NATIVE_UNION(n_window, x11_egl); if (!n_window) return NULL; xegl_display_fill_native(dpy, &n_window->x11_egl->display); n_window->x11_egl->xlib_window = self->x11.xcb; n_window->x11_egl->egl_surface = self->wegl.egl;; return n_window; }
union waffle_native_window* wgbm_window_get_native(struct wcore_window *wc_self) { struct wgbm_window *self = wgbm_window(wc_self); struct wgbm_display *dpy = wgbm_display(wc_self->display); union waffle_native_window *n_window; WCORE_CREATE_NATIVE_UNION(n_window, gbm); if (n_window == NULL) return NULL; wgbm_display_fill_native(dpy, &n_window->gbm->display); n_window->gbm->egl_surface = self->wegl.egl; n_window->gbm->gbm_surface = self->gbm_surface; return n_window; }