From 8bb5a2545ee32a8eaea964a66fc291b517b1fe7e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 5 Dec 2013 13:02:51 -0800 Subject: [PATCH] Fix extension detection on core GL contexts. The nasty old strings were deprecated. --- src/dispatch_common.c | 17 +++++++++++++++-- test/Makefile.am | 2 -- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 90ff92a..e1cb500 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -271,8 +271,21 @@ epoxy_extension_in_string(const char *extension_list, const char *ext) PUBLIC bool epoxy_has_gl_extension(const char *ext) { - return epoxy_extension_in_string((const char *)glGetString(GL_EXTENSIONS), - ext); + if (epoxy_gl_version() < 30) { + return epoxy_extension_in_string((const char *)glGetString(GL_EXTENSIONS), + ext); + } else { + int num_extensions; + + glGetIntegerv(GL_NUM_EXTENSIONS, &num_extensions); + for (int i = 0; i < num_extensions; i++) { + char *gl_ext = (char *)glGetStringi(GL_EXTENSIONS, i); + if (strcmp(ext, gl_ext) == 0) + return true; + } + + return false; + } } bool diff --git a/test/Makefile.am b/test/Makefile.am index 4fe2535..59e4ee3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -48,8 +48,6 @@ TESTS = \ headerguards \ $() -XFAIL_TESTS = glx_public_api_core - check_PROGRAMS = $(TESTS) egl_has_extension_nocontext_LDFLAGS = $(X11_LIBS) $(EPOXY) libegl_common.la