Setting Renderer default libs to use translator libs

Change-Id: I853a30ce1aa7325d01a30b30c18f4e0bd5a5702f
This commit is contained in:
Amit Feller
2011-06-21 10:01:41 +03:00
committed by Guy Zadickario
parent efcbbc3f28
commit a20ba0e4de
3 changed files with 29 additions and 4 deletions

View File

@@ -20,17 +20,25 @@
EGLDispatch s_egl;
#ifdef _WIN32
#define DEFAULT_EGL_LIB "libEGL_translator"
#elif defined(__APPLE__)
#define DEFAULT_EGL_LIB "libEGL_translator.dylib"
#else
#define DEFAULT_EGL_LIB "libEGL_translator.so"
#endif
bool init_egl_dispatch()
{
const char *libName = getenv("ANDROID_EGL_LIB");
if (!libName) libName = "libEGL.so";
if (!libName) libName = DEFAULT_EGL_LIB;
osUtils::dynLibrary *lib = osUtils::dynLibrary::open(libName);
if (!lib) {
printf("Failed to open %s\n", libName);
return NULL;
}
s_egl.eglGetError = (eglGetError_t) lib->findSymbol("eglGetError");
s_egl.eglGetDisplay = (eglGetDisplay_t) lib->findSymbol("eglGetDisplay");
s_egl.eglInitialize = (eglInitialize_t) lib->findSymbol("eglInitialize");