From 23503cb140546dc31deefb63c92e09131c91b3f0 Mon Sep 17 00:00:00 2001 From: George Wright Date: Thu, 23 Feb 2012 17:30:22 -0500 Subject: [PATCH] Modify eglplatform.h to support Android --- thirdparty/khronos/EGL/eglplatform.h | 10 ++++++++++ thirdparty/khronos/EGL/eglplatform.patch | 21 +++++++++++++++++++++ thirdparty/khronos/Makefile | 6 +++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 thirdparty/khronos/EGL/eglplatform.patch diff --git a/thirdparty/khronos/EGL/eglplatform.h b/thirdparty/khronos/EGL/eglplatform.h index 6d34ab5..5f30ef1 100644 --- a/thirdparty/khronos/EGL/eglplatform.h +++ b/thirdparty/khronos/EGL/eglplatform.h @@ -83,6 +83,16 @@ typedef int EGLNativeDisplayType; typedef void *EGLNativeWindowType; typedef void *EGLNativePixmapType; +#elif defined(__ANDROID__) || defined(ANDROID) + +#include + +struct egl_native_pixmap_t; + +typedef struct ANativeWindow* EGLNativeWindowType; +typedef struct egl_native_pixmap_t* EGLNativePixmapType; +typedef void* EGLNativeDisplayType; + #elif defined(__unix__) /* X11 (tentative) */ diff --git a/thirdparty/khronos/EGL/eglplatform.patch b/thirdparty/khronos/EGL/eglplatform.patch new file mode 100644 index 0000000..2758d7d --- /dev/null +++ b/thirdparty/khronos/EGL/eglplatform.patch @@ -0,0 +1,21 @@ +diff --git a/thirdparty/khronos/EGL/eglplatform.h b/thirdparty/khronos/EGL/eglplatform.h +index 6d34ab5..5f30ef1 100644 +--- a/thirdparty/khronos/EGL/eglplatform.h ++++ b/thirdparty/khronos/EGL/eglplatform.h +@@ -83,6 +83,16 @@ typedef int EGLNativeDisplayType; + typedef void *EGLNativeWindowType; + typedef void *EGLNativePixmapType; + ++#elif defined(__ANDROID__) || defined(ANDROID) ++ ++#include ++ ++struct egl_native_pixmap_t; ++ ++typedef struct ANativeWindow* EGLNativeWindowType; ++typedef struct egl_native_pixmap_t* EGLNativePixmapType; ++typedef void* EGLNativeDisplayType; ++ + #elif defined(__unix__) + + /* X11 (tentative) */ diff --git a/thirdparty/khronos/Makefile b/thirdparty/khronos/Makefile index 25d184b..2b5ff30 100644 --- a/thirdparty/khronos/Makefile +++ b/thirdparty/khronos/Makefile @@ -19,9 +19,13 @@ GL/wglext.h GL/glxext.h: FORCE GL/glext.h: GL/glext.sed FORCE wget -O - "http://www.opengl.org/registry/api/$(@F)" | sed -f $*.sed > $@ -EGL/egl.h EGL/eglext.h EGL/eglplatform.h KHR/khrplatform.h: FORCE +EGL/egl.h EGL/eglext.h KHR/khrplatform.h: FORCE wget -O $@ "http://www.khronos.org/registry/egl/api/$@" +EGL/eglplatform.h: EGL/eglplatform.patch FORCE + wget -O $@ "http://www.khronos.org/registry/egl/api/$@" + patch $@ EGL/eglplatform.patch + GLES/gl.h GLES/glext.h GLES/glplatform.h: FORCE wget -O $@ "http://www.khronos.org/registry/gles/api/1.1/$(@F)" -- 2.43.0