summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/context_win.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /video/out/opengl/context_win.c
parentAdding upstream version 0.37.0. (diff)
downloadmpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.tar.xz
mpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'video/out/opengl/context_win.c')
-rw-r--r--video/out/opengl/context_win.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/video/out/opengl/context_win.c b/video/out/opengl/context_win.c
index 968b176..a582e28 100644
--- a/video/out/opengl/context_win.c
+++ b/video/out/opengl/context_win.c
@@ -96,6 +96,7 @@ static bool create_dc(struct ra_ctx *ctx)
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
+ pfd.cAlphaBits = 8;
pfd.iLayerType = PFD_MAIN_PLANE;
int pf = ChoosePixelFormat(hdc, &pfd);
@@ -293,6 +294,9 @@ static bool wgl_init(struct ra_ctx *ctx)
if (!vo_w32_init(ctx->vo))
goto fail;
+ if (ctx->opts.want_alpha)
+ vo_w32_set_transparency(ctx->vo, ctx->opts.want_alpha);
+
vo_w32_run_on_thread(ctx->vo, create_ctx, ctx);
if (!p->context)
goto fail;
@@ -368,11 +372,17 @@ static int wgl_control(struct ra_ctx *ctx, int *events, int request, void *arg)
return ret;
}
+static void wgl_update_render_opts(struct ra_ctx *ctx)
+{
+ vo_w32_set_transparency(ctx->vo, ctx->opts.want_alpha);
+}
+
const struct ra_ctx_fns ra_ctx_wgl = {
- .type = "opengl",
- .name = "win",
- .init = wgl_init,
- .reconfig = wgl_reconfig,
- .control = wgl_control,
- .uninit = wgl_uninit,
+ .type = "opengl",
+ .name = "win",
+ .init = wgl_init,
+ .reconfig = wgl_reconfig,
+ .control = wgl_control,
+ .update_render_opts = wgl_update_render_opts,
+ .uninit = wgl_uninit,
};