diff options
Diffstat (limited to 'Runtime/GfxDevice/opengles/ExtensionsGLES.cpp')
-rw-r--r-- | Runtime/GfxDevice/opengles/ExtensionsGLES.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/opengles/ExtensionsGLES.cpp b/Runtime/GfxDevice/opengles/ExtensionsGLES.cpp new file mode 100644 index 0000000..a948883 --- /dev/null +++ b/Runtime/GfxDevice/opengles/ExtensionsGLES.cpp @@ -0,0 +1,30 @@ +#include "UnityPrefix.h" + +#include "ExtensionsGLES.h" +#include "IncludesGLES.h" + +#if GFX_SUPPORTS_OPENGLESXX + +#if UNITY_IPHONE + #include <dlfcn.h> +#endif + +void* GetGLExtProcAddress(const char* name) +{ +#if GFX_SUPPORTS_EGL && !UNITY_WIN + return (void*) eglGetProcAddress(name); +#elif UNITY_IPHONE + + // on ios we link to framework, so symbols are already resolved + static void* selfHandle = 0; + if(!selfHandle) + selfHandle = dlopen(0, RTLD_LOCAL | RTLD_LAZY); + + return selfHandle ? dlsym(selfHandle, name) : 0; +#else + return 0; + +#endif +} + +#endif
\ No newline at end of file |