gl_common: suggest --vo=opengl-old if OpenGL 2.1 missing

If the caller requests at least OpenGL 2.1 (which --vo=opengl does),
but we get OpenGL 1.x, suggest using opengl-old.

Based on a patch by pfor on IRC.
This commit is contained in:
wm4 2013-10-26 14:13:55 +02:00
parent 6ac5474790
commit 74e7043cc7
1 changed files with 6 additions and 1 deletions

View File

@ -944,8 +944,13 @@ bool mpgl_config_window(struct MPGLContext *ctx, int gl_caps, uint32_t d_width,
MP_WARN(ctx->vo, "Missing OpenGL features:");
list_features(missing, ctx->vo->log, MSGL_WARN, false);
if (missing & MPGL_CAP_NO_SW)
if (missing & MPGL_CAP_NO_SW) {
MP_WARN(ctx->vo, "Rejecting suspected software OpenGL renderer.\n");
} else if ((missing & MPGL_CAP_GL21) &&
(ctx->gl->mpgl_caps & MPGL_CAP_GL_LEGACY))
{
MP_WARN(ctx->vo, "OpenGL version too old. Try: --vo=opengl-old\n");
}
}
MP_ERR(ctx->vo, "OpenGL context creation failed!\n");