summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-12-11 16:34:05 -0800
committerEric Anholt <eric@anholt.net>2013-12-11 17:18:28 -0800
commit708c31a4064f67d4ac4ef8877a4b6c313e4dbc5a (patch)
treee3ec28464db33e62e6c05c0f08abe4537e7cebc3 /src
parent940438fae3715547256d3cf220e886bbe972521a (diff)
Disable EGL on OS X.
It doesn't exist. There's EAGL, but that's not something we're covering.
Diffstat (limited to 'src')
-rw-r--r--src/dispatch_common.c14
-rw-r--r--src/dispatch_common.h4
2 files changed, 17 insertions, 1 deletions
diff --git a/src/dispatch_common.c b/src/dispatch_common.c
index d5051cd..ac92712 100644
--- a/src/dispatch_common.c
+++ b/src/dispatch_common.c
@@ -310,7 +310,11 @@ epoxy_conservative_has_gl_extension(const char *ext)
void *
epoxy_egl_dlsym(const char *name)
{
+#if PLATFORM_HAS_EGL
return do_dlsym(&api.egl_handle, "libEGL.so.1", name, true);
+#else
+ return NULL;
+#endif
}
void *
@@ -365,7 +369,11 @@ epoxy_get_proc_address(const char *name)
return wglGetProcAddress(name);
#else
if (api.egl_handle) {
+#if PLATFORM_HAS_EGL
return eglGetProcAddress(name);
+#else
+ return NULL;
+#endif
} else if (api.glx_handle) {
return glXGetProcAddressARB((const GLubyte *)name);
} else {
@@ -377,16 +385,19 @@ epoxy_get_proc_address(const char *name)
* application's namespace, then use that.
*/
PFNGLXGETPROCADDRESSARBPROC glx_gpa;
- PFNEGLGETPROCADDRESSPROC egl_gpa;
+#if PLATFORM_HAS_EGL
+ PFNEGLGETPROCADDRESSPROC egl_gpa;
egl_gpa = dlsym(NULL, "eglGetProcAddress");
if (egl_gpa)
return egl_gpa(name);
+#endif
glx_gpa = dlsym(NULL, "glXGetProcAddressARB");
if (glx_gpa)
return glx_gpa((const GLubyte *)name);
+#if PLATFORM_HAS_EGL
/* OK, couldn't find anything in the app's address space.
* Presumably they dlopened with RTLD_LOCAL, which hides it
* from us. Just go dlopen()ing likely libraries and try them.
@@ -395,6 +406,7 @@ epoxy_get_proc_address(const char *name)
false);
if (egl_gpa)
return egl_gpa(name);
+#endif /* PLATFORM_HAS_EGL */
return do_dlsym(&api.glx_handle, "libGL.so.1", "glXGetProcAddressARB",
false);
diff --git a/src/dispatch_common.h b/src/dispatch_common.h
index f18fd7b..45b6c45 100644
--- a/src/dispatch_common.h
+++ b/src/dispatch_common.h
@@ -27,6 +27,10 @@
#define PLATFORM_HAS_EGL 0
#define PLATFORM_HAS_GLX 0
#define PLATFORM_HAS_WGL 1
+#elif defined(__APPLE__)
+#define PLATFORM_HAS_EGL 0
+#define PLATFORM_HAS_GLX 1
+#define PLATFORM_HAS_WGL 0
#else
#define PLATFORM_HAS_EGL 1
#define PLATFORM_HAS_GLX 1