summaryrefslogtreecommitdiffstats
path: root/libvo/vo_corevideo.m
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-03 01:54:13 +0200
committerwm4 <wm4@nowhere>2012-10-03 03:17:38 +0200
commita0b43a11e4e0edd6077c926f012c5f5c31a04e45 (patch)
tree4799a577f03a88229ca936523a6334a4f0d01bbe /libvo/vo_corevideo.m
parentdb565ca4f88dcd18b7e2a2a1e7a666d14f1e0a2f (diff)
downloadmpv-a0b43a11e4e0edd6077c926f012c5f5c31a04e45.tar.bz2
mpv-a0b43a11e4e0edd6077c926f012c5f5c31a04e45.tar.xz
vo_gl3: make it work on OpenGL 2.1
Now vo_gl3 should work with standard OpenGL 2.1, as long as the GL_ARB_texture_rg extension is available. Optional features, which require features that are always in OpenGL 3.0, but are available as extensions only in OpenGL 2.1, are automatically disabled. The force-gl2 suboption, which was an unreliable hack to run vo_gl3 in an OpenGL 2.1 context, is removed. Significant changes are done to the extension loader to make it easier to identify optional OpenGL features. Context creation is a bit changed to simplify the code and to handle the fallback better if OpenGL 3 context creation fails, and creating an OpenGL legacy context is attempted. Based on the initial work by Rudolf Polzer <divverent@xonotic.org>, which included making the shader GLSL 1.20 compatible, and more.
Diffstat (limited to 'libvo/vo_corevideo.m')
-rw-r--r--libvo/vo_corevideo.m9
1 files changed, 4 insertions, 5 deletions
diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m
index 1d10330bcb..d92e11ca1c 100644
--- a/libvo/vo_corevideo.m
+++ b/libvo/vo_corevideo.m
@@ -154,9 +154,8 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
p->image_width = width;
p->image_height = height;
- if (p->mpglctx->create_window(p->mpglctx, d_width, d_height, flags) < 0)
- return -1;
- if (p->mpglctx->setGlWindow(p->mpglctx) == SET_WINDOW_FAILED)
+ int mpgl_caps = MPGL_CAP_GL_LEGACY;
+ if (!mpgl_create_window(p->mpglctx, mpgl_caps, d_width, d_height, flags))
return -1;
init_gl(vo, vo->dwidth, vo->dheight);
@@ -367,7 +366,7 @@ static int query_format(struct vo *vo, uint32_t format)
static void uninit(struct vo *vo)
{
struct priv *p = vo->priv;
- uninit_mpglcontext(p->mpglctx);
+ mpgl_uninit(p->mpglctx);
release_cv_entities(vo);
}
@@ -377,7 +376,7 @@ static int preinit(struct vo *vo, const char *arg)
struct priv *p = vo->priv;
*p = (struct priv) {
- .mpglctx = init_mpglcontext(GLTYPE_COCOA, vo),
+ .mpglctx = mpgl_init(GLTYPE_COCOA, vo),
.colorspace = MP_CSP_DETAILS_DEFAULTS,
.quad = talloc_ptrtype(p, p->quad),
.osd = talloc_ptrtype(p, p->osd),