diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2021-10-02 21:30:10 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-10-16 20:33:53 +0000 |
commit | 20e9c66fa935807ca5d11eedf82fbfd3db807c04 (patch) | |
tree | c93eb68eb322df5965e42bddcbc203527f5aaf5e /video/out/opengl/common.c | |
parent | 538fb6541e621fd6eb1c0fe42bb88520e8e45dda (diff) | |
download | mpv-20e9c66fa935807ca5d11eedf82fbfd3db807c04.tar.bz2 mpv-20e9c66fa935807ca5d11eedf82fbfd3db807c04.tar.xz |
egl_helpers: fixup the EGL_KHR_create_context-less codepath
With earlier commit f8e62d3d82 ("egl_helpers: fix create_context
fallback behavior") we added a fallback for creating OpenGL context
while EGL_KHR_create_context is missing.
While it looked correct at first, it is missing the eglMakeCurrent()
call after creating the EGL context. Thus calling glGetString() fails.
Instead of doing that we can just remove some code - simply pass the
CLIENT_VERSION 2, as attributes which is honoured by EGL regardless of
the client API. This allows us to remove the special case and drop some
code.
v2:
- mpgl_preferred_gl_versions -> mpgl_min_required_gl_versions
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'video/out/opengl/common.c')
-rw-r--r-- | video/out/opengl/common.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index ed0b0d4747..1a5efe0460 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -486,27 +486,6 @@ static const struct gl_functions gl_functions[] = { #undef DEF_FN #undef DEF_FN_NAME -void mpgl_check_version(GL *gl, void *(*get_fn)(void *ctx, const char *n), - void *fn_ctx) -{ - gl->GetString = get_fn(fn_ctx, "glGetString"); - if (!gl->GetString) { - gl->version = 0; - return; - } - const char *version_string = gl->GetString(GL_VERSION); - if (!version_string) { - gl->version = 0; - return; - } - int major = 0, minor = 0; - if (sscanf(version_string, "%d.%d", &major, &minor) < 2) { - gl->version = 0; - return; - } - gl->version = MPGL_VER(major, minor); -} - // Fill the GL struct with function pointers and extensions from the current // GL context. Called by the backend. // get_fn: function to resolve function names |