Skip to content

Commit 12a7dcc

Browse files
committed
add epoxy_set_library_path for android
this is used in termux to load angle a mobile driver optimised for mali currently the regular epoxy packet lacks this function adding to the already overwhelming confusion over what actually works. everything works in termux but there are many paths that fail. I am trying to widen the road that lead to life the angle drivers have been hard coded for simplicity. Never calling this function will use the regular driver
1 parent e98617e commit 12a7dcc

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

include/epoxy/common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ EPOXY_BEGIN_DECLS
5757

5858
EPOXY_PUBLIC bool epoxy_extension_in_string(const char *extension_list,
5959
const char *ext);
60+
#if defined(__ANDROID__)
61+
EPOXY_PUBLIC void epoxy_set_library_path(const char * path);
62+
#endif
6063

6164
EPOXY_END_DECLS
6265

src/dispatch_common.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,16 @@
179179
#define GLES1_LIB "libGLESv1_CM.so"
180180
#define GLES2_LIB "libGLESv2.so"
181181
#elif defined(__ANDROID__)
182-
#define GLX_LIB "libGLESv2.so"
183-
#define EGL_LIB "libEGL.so"
184-
#define GLES1_LIB "libGLESv1_CM.so"
185-
#define GLES2_LIB "libGLESv2.so"
182+
#define GLX_LIB GLES2_LIB
183+
static char EGL_LIB[256] = "libEGL.so";
184+
static char GLES1_LIB[256] = "libGLESv1_CM.so";
185+
static char GLES2_LIB[256] = "libGLESv2.so";
186+
EPOXY_PUBLIC void epoxy_set_library_path(const char * path) {
187+
char *prefix = getenv("PREFIX");
188+
snprintf(EGL_LIB, sizeof(EGL_LIB), "%s/%s/libEGL_angle.so", prefix, path);
189+
snprintf(GLES1_LIB, sizeof(GLES1_LIB), "%s/%s/libGLESv1_CM_angle.so", prefix, path);
190+
snprintf(GLES2_LIB, sizeof(GLES2_LIB), "%s/%s/libGLESv2_angle.so", prefix, path);
191+
}
186192
#elif defined(_WIN32)
187193
#define EGL_LIB "libEGL.dll"
188194
#define GLES1_LIB "libGLES_CM.dll"

0 commit comments

Comments
 (0)