Skip to content

add epoxy_set_library_path for android #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/epoxy/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ EPOXY_BEGIN_DECLS

EPOXY_PUBLIC bool epoxy_extension_in_string(const char *extension_list,
const char *ext);
#if defined(__ANDROID__)
EPOXY_PUBLIC void epoxy_set_library_path(const char * path, const char * suffix);
#endif

EPOXY_END_DECLS

Expand Down
16 changes: 12 additions & 4 deletions src/dispatch_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,18 @@
#define GLES1_LIB "libGLESv1_CM.so"
#define GLES2_LIB "libGLESv2.so"
#elif defined(__ANDROID__)
#define GLX_LIB "libGLESv2.so"
#define EGL_LIB "libEGL.so"
#define GLES1_LIB "libGLESv1_CM.so"
#define GLES2_LIB "libGLESv2.so"
#define GLX_LIB GLES2_LIB
static char EGL_LIB[PATH_MAX] = "libEGL.so";
static char GLES1_LIB[PATH_MAX] = "libGLESv1_CM.so";
static char GLES2_LIB[PATH_MAX] = "libGLESv2.so";
/* example for angle-gl platform */
/* epoxy_set_library_path("opt/angle-android/gl", "_angle); */
EPOXY_PUBLIC void epoxy_set_library_path(const char * path, const char * suffix) {
char *prefix = getenv("PREFIX");
sprintf(EGL_LIB, "%s/%s/libEGL%s.so", prefix, path, suffix);
sprintf(GLES1_LIB, "%s/%s/libGLESv1_CM%s.so", prefix, path, suffix);
sprintf(GLES2_LIB, "%s/%s/libGLESv2%s.so", prefix, path, suffix);
}
#elif defined(_WIN32)
#define EGL_LIB "libEGL.dll"
#define GLES1_LIB "libGLES_CM.dll"
Expand Down
2 changes: 1 addition & 1 deletion src/gen_dispatch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/bin/env python3
# -*- coding: utf-8 -*-

# Copyright © 2013 Intel Corporation
Expand Down