Beispiel #1
0
static bool config_window_wayland(struct MPGLContext *ctx,
                                  uint32_t d_width,
                                  uint32_t d_height,
                                  uint32_t flags)
{
    struct vo_wayland_state * wl = ctx->vo->wayland;
    bool enable_alpha = !!(flags & VOFLAG_ALPHA);
    bool ret = false;

    if (!vo_wayland_config(ctx->vo, d_width, d_height, flags))
        return false;

    if (!wl->egl_context.egl.ctx) {
        /* Create OpenGL context */
        ret = egl_create_context(wl, ctx, enable_alpha);

        /* If successfully created the context and we don't want to hide the
         * window than also create the window immediately */
        if (ret && !(VOFLAG_HIDDEN & flags))
            egl_create_window(wl, d_width, d_height);

        return ret;
    }
    else {
        if (!wl->egl_context.egl_window) {
            /* If the context exists and the hidden flag is unset then
             * create the window */
            if (!(VOFLAG_HIDDEN & flags))
                egl_create_window(wl, d_width, d_height);
        }
        return true;
    }
}
Beispiel #2
0
static int waylandgl_reconfig(struct MPGLContext *ctx)
{
    struct vo_wayland_state * wl = ctx->vo->wayland;

    if (!vo_wayland_config(ctx->vo))
        return -1;

    if (!wl->egl_context.egl_window)
        egl_create_window(wl);

    return 0;
}