diff options
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r-- | video/out/opengl/utils.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c index 3b296d52de..38982e501e 100644 --- a/video/out/opengl/utils.c +++ b/video/out/opengl/utils.c @@ -267,3 +267,21 @@ void gl_set_debug_logger(GL *gl, struct mp_log *log) if (gl->DebugMessageCallback) gl->DebugMessageCallback(log ? gl_debug_cb : NULL, log); } + +// Given a GL combined extension string in extensions, find out whether ext +// is included in it. Basically, a word search. +bool gl_check_extension(const char *extensions, const char *ext) +{ + int len = strlen(ext); + const char *cur = extensions; + while (cur) { + cur = strstr(cur, ext); + if (!cur) + break; + if ((cur == extensions || cur[-1] == ' ') && + (cur[len] == '\0' || cur[len] == ' ')) + return true; + cur += len; + } + return false; +} |