diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2012-04-10 18:38:28 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2012-04-11 16:47:08 -0700 |
commit | 9898fa024b56c74e289ed5cc1ec55e6e8e79d0dd (patch) | |
tree | e17ae8ca4b2cdad23a2b64b854bb9d4ce46b0750 | |
parent | 818624ab661d2467a82db87122be0f0d27acc4b0 (diff) |
core: Create and destroy glx_platform
If the WAFFLE_PLATFORM attribute is WAFFLE_PLATFORM_GLX, then
create/destroy a glx_platform in wcore_platform_create/destroy.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r-- | src/waffle/core/wcore_platform.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/waffle/core/wcore_platform.c b/src/waffle/core/wcore_platform.c index 5bc16d2..50ed4c1 100644 --- a/src/waffle/core/wcore_platform.c +++ b/src/waffle/core/wcore_platform.c @@ -20,6 +20,7 @@ #include <stdlib.h> #include <waffle/waffle_enum.h> +#include <waffle/glx/glx_platform.h> #include <waffle/x11_egl/xegl_platform.h> #include "wcore_error.h" @@ -46,6 +47,11 @@ wcore_platform_create(int platform, int gl_api) self->gl_api = gl_api; switch (platform) { + case WAFFLE_PLATFORM_GLX: + self->native = glx_platform_create(gl_api, &self->dispatch); + if (!self->native) + goto error; + break; case WAFFLE_PLATFORM_X11_EGL: self->native = xegl_platform_create(gl_api, &self->dispatch); if (!self->native) @@ -76,6 +82,9 @@ wcore_platform_destroy(struct wcore_platform *self) return true; switch (self->native_tag) { + case WAFFLE_PLATFORM_GLX: + ok &= glx_platform_destroy(self->native); + break; case WAFFLE_PLATFORM_X11_EGL: ok &= xegl_platform_destroy(self->native); break; |