예제 #1
0
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;
}
예제 #2
0
파일: wegl_util.c 프로젝트: Jul13t/waffle
bool
wegl_make_current(struct wcore_platform *wc_plat,
                  struct wcore_display *wc_dpy,
                  struct wcore_window *wc_window,
                  struct wcore_context *wc_ctx)
{
    struct wegl_platform *plat = wegl_platform(wc_plat);
    EGLSurface surface = wc_window ? wegl_window(wc_window)->egl : NULL;
    bool ok;

    ok = plat->eglMakeCurrent(wegl_display(wc_dpy)->egl,
                              surface,
                              surface,
                              wc_ctx
                                  ? wegl_context(wc_ctx)->egl
                                  : NULL);
    if (!ok)
        wegl_emit_error(plat, "eglMakeCurrent");

    return ok;
}