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; 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() bool init_egl_dispatch()
{ {
const char *libName = getenv("ANDROID_EGL_LIB"); 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); osUtils::dynLibrary *lib = osUtils::dynLibrary::open(libName);
if (!lib) { if (!lib) {
printf("Failed to open %s\n", libName); printf("Failed to open %s\n", libName);
return NULL; return NULL;
} }
s_egl.eglGetError = (eglGetError_t) lib->findSymbol("eglGetError"); s_egl.eglGetError = (eglGetError_t) lib->findSymbol("eglGetError");
s_egl.eglGetDisplay = (eglGetDisplay_t) lib->findSymbol("eglGetDisplay"); s_egl.eglGetDisplay = (eglGetDisplay_t) lib->findSymbol("eglGetDisplay");
s_egl.eglInitialize = (eglInitialize_t) lib->findSymbol("eglInitialize"); s_egl.eglInitialize = (eglInitialize_t) lib->findSymbol("eglInitialize");

View File

@@ -23,6 +23,14 @@ gl2_decoder_context_t s_gl2;
static osUtils::dynLibrary *s_gles2_lib = NULL; static osUtils::dynLibrary *s_gles2_lib = NULL;
#ifdef _WIN32
#define DEFAULT_GLES_V2_LIB "libGLES_V2_translator"
#elif defined(__APPLE__)
#define DEFAULT_GLES_V2_LIB "libGLES_V2_translator.dylib"
#else
#define DEFAULT_GLES_V2_LIB "libGLES_V2_translator.so"
#endif
// //
// This function is called only once during initialiation before // This function is called only once during initialiation before
// any thread has been created - hence it should NOT be thread safe. // any thread has been created - hence it should NOT be thread safe.
@@ -30,7 +38,7 @@ static osUtils::dynLibrary *s_gles2_lib = NULL;
bool init_gl2_dispatch() bool init_gl2_dispatch()
{ {
const char *libName = getenv("ANDROID_GLESv2_LIB"); const char *libName = getenv("ANDROID_GLESv2_LIB");
if (!libName) libName = "libGLESv2.so"; if (!libName) libName = DEFAULT_GLES_V2_LIB;
// //
// Load the GLES library // Load the GLES library

View File

@@ -26,10 +26,19 @@ static osUtils::dynLibrary *s_gles_lib = NULL;
// This function is called only once during initialiation before // This function is called only once during initialiation before
// any thread has been created - hence it should NOT be thread safe. // any thread has been created - hence it should NOT be thread safe.
// //
#ifdef _WIN32
#define DEFAULT_GLES_CM_LIB "libGLES_CM_translator"
#elif defined(__APPLE__)
#define DEFAULT_GLES_CM_LIB "libGLES_CM_translator.dylib"
#else
#define DEFAULT_GLES_CM_LIB "libGLES_CM_translator.so"
#endif
bool init_gl_dispatch() bool init_gl_dispatch()
{ {
const char *libName = getenv("ANDROID_GLESv1_LIB"); const char *libName = getenv("ANDROID_GLESv1_LIB");
if (!libName) libName = "libGLES_CM.so"; if (!libName) libName = DEFAULT_GLES_CM_LIB;
s_gles_lib = osUtils::dynLibrary::open(libName); s_gles_lib = osUtils::dynLibrary::open(libName);
if (!s_gles_lib) return false; if (!s_gles_lib) return false;