summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/opengles/ExtensionsGLES.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/opengles/ExtensionsGLES.cpp
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/GfxDevice/opengles/ExtensionsGLES.cpp')
-rw-r--r--Runtime/GfxDevice/opengles/ExtensionsGLES.cpp30
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