summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-01 15:55:08 +0100
committerwm4 <wm4@nowhere>2013-03-28 21:46:17 +0100
commit16e951c2cdfa6710f0d5cc77b513e0f2a5f1377d (patch)
tree8c5d12be204f0f03437041b31cf7fb7272101b7f /video/out/vo_opengl.c
parent3374a43998f183b585640de0a588db2431ed87ae (diff)
downloadmpv-16e951c2cdfa6710f0d5cc77b513e0f2a5f1377d.tar.bz2
mpv-16e951c2cdfa6710f0d5cc77b513e0f2a5f1377d.tar.xz
gl_common: split into platform specific files
Do this instead of stuffing all x11/cocoa/win32/wayland specific code into gl_common.c. The cocoa specific parts could probably go directly into cocoa_common.m, possibly same with wayland. Also redo how the list of backends is managed. Get rid of the GLTYPE_ constants. Instead of having a big switch() on GLTYPE_, each backend entry has a function pointer to setup the MPGLContext callback (e.g. mpgl_set_backend_x11()).
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r--video/out/vo_opengl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index fd585a6da4..4a9c2e4f39 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -1943,7 +1943,7 @@ static int lut3d_size_valid(void *arg)
static int backend_valid(void *arg)
{
- return mpgl_find_backend(*(const char **)arg) >= 0;
+ return mpgl_find_backend(*(const char **)arg) >= -1;
}
struct fbo_format {
@@ -2146,7 +2146,7 @@ static int preinit(struct vo *vo, const char *arg)
goto err_out;
}
- int backend = backend_arg ? mpgl_find_backend(backend_arg) : GLTYPE_AUTO;
+ char *backend = talloc_strdup(vo, backend_arg);
free(backend_arg);
if (fbo_format)
@@ -2178,7 +2178,7 @@ static int preinit(struct vo *vo, const char *arg)
p->orig_cmdline = talloc(p, struct gl_priv);
*p->orig_cmdline = *p;
- p->glctx = mpgl_init(backend, vo);
+ p->glctx = mpgl_init(vo, backend);
if (!p->glctx)
goto err_out;
p->gl = p->glctx->gl;