From: Frank Henigman <fjhenig...@gmail.com> Store EGLImageCreateKHR and EGLImageDestroyKHR in the EGL platform struct.
Signed-off-by: Frank Henigman <fjhenig...@google.com> --- src/waffle/egl/wegl_platform.c | 9 ++++++++- src/waffle/egl/wegl_platform.h | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/waffle/egl/wegl_platform.c b/src/waffle/egl/wegl_platform.c index 800025e..0c9eb44 100644 --- a/src/waffle/egl/wegl_platform.c +++ b/src/waffle/egl/wegl_platform.c @@ -72,8 +72,11 @@ wegl_platform_init(struct wegl_platform *self) goto error; } +#define OPTIONAL_EGL_SYMBOL(function) \ + self->function = dlsym(self->eglHandle, #function); + #define RETRIEVE_EGL_SYMBOL(function) \ - self->function = dlsym(self->eglHandle, #function); \ + OPTIONAL_EGL_SYMBOL(function) \ if (!self->function) { \ wcore_errorf(WAFFLE_ERROR_FATAL, \ "dlsym(\"%s\", \"" #function "\") failed: %s", \ @@ -82,6 +85,9 @@ wegl_platform_init(struct wegl_platform *self) goto error; \ } + OPTIONAL_EGL_SYMBOL(eglCreateImageKHR); + OPTIONAL_EGL_SYMBOL(eglDestroyImageKHR); + RETRIEVE_EGL_SYMBOL(eglMakeCurrent); RETRIEVE_EGL_SYMBOL(eglGetProcAddress); @@ -106,6 +112,7 @@ wegl_platform_init(struct wegl_platform *self) RETRIEVE_EGL_SYMBOL(eglDestroySurface); RETRIEVE_EGL_SYMBOL(eglSwapBuffers); +#undef OPTIONAL_EGL_SYMBOL #undef RETRIEVE_EGL_SYMBOL error: diff --git a/src/waffle/egl/wegl_platform.h b/src/waffle/egl/wegl_platform.h index 645c3f8..7ae0490 100644 --- a/src/waffle/egl/wegl_platform.h +++ b/src/waffle/egl/wegl_platform.h @@ -26,6 +26,7 @@ #pragma once #include <EGL/egl.h> +#include <EGL/eglext.h> #include "wcore_platform.h" #include "wcore_util.h" @@ -68,6 +69,9 @@ struct wegl_platform { const EGLint *attrib_list); EGLBoolean (*eglDestroySurface)(EGLDisplay dpy, EGLSurface surface); EGLBoolean (*eglSwapBuffers)(EGLDisplay dpy, EGLSurface surface); + + EGLImageKHR (*eglCreateImageKHR) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); + EGLBoolean (*eglDestroyImageKHR)(EGLDisplay dpy, EGLImageKHR image); }; DEFINE_CONTAINER_CAST_FUNC(wegl_platform, -- 2.2.0.rc0.207.ga3a616c _______________________________________________ waffle mailing list waffle@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/waffle