Commit 116a6faf authored by Ryan C. Gordon's avatar Ryan C. Gordon

Implement GL_GetProcAddress() for Android.

Fixes Bugzilla #1290.

Thanks to Gabriel Jacobo for the patch!

--HG--
extra : rebase_source : 80bd6c922b4e9c74582cc85d62462d87431315bd
parent 32104bc3
...@@ -29,26 +29,43 @@ ...@@ -29,26 +29,43 @@
#include <android/log.h> #include <android/log.h>
#include <dlfcn.h>
static void* Android_GLHandle = NULL;
/* GL functions */ /* GL functions */
int int
Android_GL_LoadLibrary(_THIS, const char *path) Android_GL_LoadLibrary(_THIS, const char *path)
{ {
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n"); if (!Android_GLHandle) {
Android_GLHandle = dlopen("libGLESv1_CM.so",RTLD_GLOBAL);
if (!Android_GLHandle) {
SDL_SetError("Could not initialize GL ES library\n");
return -1;
}
}
return 0; return 0;
} }
void * void *
Android_GL_GetProcAddress(_THIS, const char *proc) Android_GL_GetProcAddress(_THIS, const char *proc)
{ {
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetProcAddress\n"); /*
return 0; !!! FIXME: this _should_ use eglGetProcAddress(), but it appears to be
!!! FIXME: busted on Android at the moment...
!!! FIXME: http://code.google.com/p/android/issues/detail?id=7681
!!! FIXME: ...so revisit this later. --ryan.
*/
return dlsym(Android_GLHandle, proc);
} }
void void
Android_GL_UnloadLibrary(_THIS) Android_GL_UnloadLibrary(_THIS)
{ {
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_UnloadLibrary\n"); if(Android_GLHandle) {
dlclose(Android_GLHandle);
Android_GLHandle = NULL;
}
} }
SDL_GLContext SDL_GLContext
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment