summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/context_win.c
diff options
context:
space:
mode:
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,
};