diff options
author | wm4 <wm4@nowhere> | 2015-12-19 09:30:20 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-19 10:24:03 +0100 |
commit | d2baaaa7df87eba9566fb935eeab5bd0af80fe1b (patch) | |
tree | 280326dfe7742c9623a3664e047baac118d1c273 /video/out/opengl | |
parent | fc9eef3b814ab0cb8134fdb8f249b48e490a9d4e (diff) | |
download | mpv-d2baaaa7df87eba9566fb935eeab5bd0af80fe1b.tar.bz2 mpv-d2baaaa7df87eba9566fb935eeab5bd0af80fe1b.tar.xz |
vo_opengl: cocoa: implement alpha window support
With --vo=opengl:alpha=yes, the Cocoa backend will now render alpha
video without background.
Diffstat (limited to 'video/out/opengl')
-rw-r--r-- | video/out/opengl/cocoa.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/video/out/opengl/cocoa.c b/video/out/opengl/cocoa.c index 7d367e99b4..5e98fce8a1 100644 --- a/video/out/opengl/cocoa.c +++ b/video/out/opengl/cocoa.c @@ -99,7 +99,7 @@ error_out: return err; } -static bool create_gl_context(struct MPGLContext *ctx) +static bool create_gl_context(struct MPGLContext *ctx, int vo_flags) { struct cgl_context *p = ctx->priv; CGLError err; @@ -124,6 +124,9 @@ static bool create_gl_context(struct MPGLContext *ctx) vo_cocoa_set_opengl_ctx(ctx->vo, p->ctx); CGLSetCurrentContext(p->ctx); + if (vo_flags & VOFLAG_ALPHA) + CGLSetParameter(p->ctx, kCGLCPSurfaceOpacity, &(GLint){0}); + ctx->depth_r = ctx->depth_g = ctx->depth_b = cgl_color_size(ctx); mpgl_load_functions(ctx->gl, (void *)cocoa_glgetaddr, NULL, ctx->vo->log); @@ -143,7 +146,7 @@ static int cocoa_init(MPGLContext *ctx, int vo_flags) { vo_cocoa_init(ctx->vo); - if (!create_gl_context(ctx)) + if (!create_gl_context(ctx, vo_flags)) return -1; ctx->gl->SwapInterval = set_swap_interval; |