summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/x11.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-19 11:56:19 +0100
committerwm4 <wm4@nowhere>2015-12-19 14:14:12 +0100
commit3394d37b4ea6876c0a4484c51ba23e6b8ed08e5a (patch)
tree95e646d22bb8ca0ffb28e9c5850a1241739da8ec /video/out/opengl/x11.c
parentd2baaaa7df87eba9566fb935eeab5bd0af80fe1b (diff)
downloadmpv-3394d37b4ea6876c0a4484c51ba23e6b8ed08e5a.tar.bz2
mpv-3394d37b4ea6876c0a4484c51ba23e6b8ed08e5a.tar.xz
vo_opengl: refactor how framebuffer depth is passed from backends
Store the determined framebuffer depth in struct GL instead of MPGLContext. This means gl_video_set_output_depth() can be removed, and also justifies adding new fields describing framebuffer/backend properties to struct GL instead of having to add more functions just to shovel the information around. Keep in mind that mpgl_load_functions() will wipe struct GL, so the new fields must be set before calling it.
Diffstat (limited to 'video/out/opengl/x11.c')
-rw-r--r--video/out/opengl/x11.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/video/out/opengl/x11.c b/video/out/opengl/x11.c
index 0a102e124f..1ef44ab604 100644
--- a/video/out/opengl/x11.c
+++ b/video/out/opengl/x11.c
@@ -253,11 +253,6 @@ static int glx_init(struct MPGLContext *ctx, int flags)
MP_WARN(vo, "Selected GLX FB config has no associated X visual\n");
}
-
- glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_RED_SIZE, &ctx->depth_r);
- glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_GREEN_SIZE, &ctx->depth_g);
- glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_BLUE_SIZE, &ctx->depth_b);
-
if (!vo_x11_create_vo_window(vo, glx_ctx->vinfo, "gl"))
goto uninit;
@@ -274,6 +269,10 @@ static int glx_init(struct MPGLContext *ctx, int flags)
if (!success)
goto uninit;
+ glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_RED_SIZE, &ctx->gl->fb_r);
+ glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_GREEN_SIZE, &ctx->gl->fb_g);
+ glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_BLUE_SIZE, &ctx->gl->fb_b);
+
return 0;
uninit: