vo_opengl: log if glGetString(GL_VERSION) returns NULL

Typically happens with some implementations if no context is currrent,
or is otherwise broken. This is particularly relevant to the opengl_cb
API, because the API user will have no other indication what went wrong.
This commit is contained in:
wm4 2016-04-08 10:57:21 +02:00
parent 813372d6e9
commit 6325bdf197
1 changed files with 3 additions and 1 deletions

View File

@ -369,8 +369,10 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n),
int major = 0, minor = 0;
const char *version_string = gl->GetString(GL_VERSION);
if (!version_string)
if (!version_string) {
mp_fatal(log, "glGetString(GL_VERSION) returned NULL.\n");
goto error;
}
mp_verbose(log, "GL_VERSION='%s'\n", version_string);
if (strncmp(version_string, "OpenGL ES ", 10) == 0) {
version_string += 10;