diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2012-04-09 20:52:51 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2012-04-10 19:18:37 -0700 |
commit | fc147e2825f97697ee8a5a3e0ac2911855a847d0 (patch) | |
tree | 632647160f54bc6c2141ecc47d6aa1b7d09af52a | |
parent | 6e9e20cd4946655da2212137eec27912bc6599cb (diff) |
xegl: set/unset env var EGL_PLATFORM
If Mesa's libEGL is built with support for multiple platforms (for
example, X11 and Wayland), then the EGL_PLATFORM environment variable must
be set before the first EGL call. Otherwise, libEGL may initialize itself
with the incorrect platform.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r-- | src/waffle/x11_egl/xegl_platform.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/waffle/x11_egl/xegl_platform.c b/src/waffle/x11_egl/xegl_platform.c index 71fe747..8666aa6 100644 --- a/src/waffle/x11_egl/xegl_platform.c +++ b/src/waffle/x11_egl/xegl_platform.c @@ -14,6 +14,8 @@ #include "xegl_platform.h" +#define _POSIX_C_SOURCE 200112 // glib feature macro for unsetenv() + #include <dlfcn.h> #include <stdlib.h> @@ -69,6 +71,7 @@ xegl_platform_create( goto error; } + setenv("EGL_PLATFORM", "x11", true); ok &= egl_bind_api(gl_api); if (!ok) goto error; @@ -98,6 +101,8 @@ xegl_platform_destroy(union native_platform *self) if (!self) return true; + unsetenv("EGL_PLATFORM"); + if (self->xegl->libgl) { error |= dlclose(self->xegl->libgl); if (error) { |