Move the check for whether to dlsym or GPA on linux to the common C code.

This is going to change for macos and win32, and this will be easier
than trying to spread that logic through the python code and into the
generated code.
macos/v1.5.9
Eric Anholt 11 years ago
parent d73f06fb45
commit b128dd9b25
  1. 10
      src/dispatch_common.c
  2. 1
      src/dispatch_common.h
  3. 10
      src/gen_dispatch.py

@ -338,6 +338,16 @@ epoxy_gles2_dlsym(const char *name)
return do_dlsym(&api.gles1_handle, "libGLESv2.so.2", name, true);
}
void *
epoxy_get_core_proc_address(const char *name, int core_version)
{
if (core_version <= 12) {
return epoxy_gl_dlsym(name);
} else {
return epoxy_get_proc_address(name);
}
}
void *
epoxy_get_proc_address(const char *name)
{

@ -55,6 +55,7 @@ void *epoxy_gl_dlsym(const char *name);
void *epoxy_gles1_dlsym(const char *name);
void *epoxy_gles2_dlsym(const char *name);
void *epoxy_get_proc_address(const char *name);
void *epoxy_get_core_proc_address(const char *name, int core_version);
int epoxy_conservative_gl_version(void);
bool epoxy_conservative_has_gl_extension(const char *name);

@ -282,14 +282,8 @@ class Generator(object):
human_name = 'Desktop OpenGL {0}'.format(feature.get('number'))
condition = 'epoxy_is_desktop_gl()'
# Everything in GL 1.2 is guaranteed to be present as
# public symbols in the Linux libGL ABI. Everything
# else is supposed to not be present, so you have to
# glXGetProcAddress() it.
if version <= 12:
loader = 'epoxy_gl_dlsym({0})'
else:
loader = 'epoxy_get_proc_address({0})'
loader = 'epoxy_get_core_proc_address({0}, {1})'.format('{0}', version)
if version >= 11:
condition += ' && epoxy_conservative_gl_version() >= {0}'.format(version)
elif api == 'gles2':
human_name = 'OpenGL ES {0}'.format(feature.get('number'))

Loading…
Cancel
Save