Fix extension detection on core GL contexts.

The nasty old strings were deprecated.
macos/v1.5.9
Eric Anholt 11 years ago
parent 20f03e65c4
commit 8bb5a2545e
  1. 17
      src/dispatch_common.c
  2. 2
      test/Makefile.am

@ -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

@ -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

Loading…
Cancel
Save