]> git.cworth.org Git - apitrace/commitdiff
Modify eglplatform.h to support Android
authorGeorge Wright <george@mozilla.com>
Thu, 23 Feb 2012 22:30:22 +0000 (17:30 -0500)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 14 Mar 2012 09:14:54 +0000 (09:14 +0000)
thirdparty/khronos/EGL/eglplatform.h
thirdparty/khronos/EGL/eglplatform.patch [new file with mode: 0644]
thirdparty/khronos/Makefile

index 6d34ab55db9fda679e8839b754dad4adffe375c9..5f30ef1c22ee7889edf4c2f9e25ca2908e3bd45b 100644 (file)
@@ -83,6 +83,16 @@ typedef int   EGLNativeDisplayType;
 typedef void *EGLNativeWindowType;
 typedef void *EGLNativePixmapType;
 
+#elif defined(__ANDROID__) || defined(ANDROID)
+
+#include <android/native_window.h>
+
+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 (file)
index 0000000..2758d7d
--- /dev/null
@@ -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 <android/native_window.h>
++
++struct egl_native_pixmap_t;
++
++typedef struct ANativeWindow*           EGLNativeWindowType;
++typedef struct egl_native_pixmap_t*     EGLNativePixmapType;
++typedef void*                           EGLNativeDisplayType;
++
+ #elif defined(__unix__)
+ /* X11 (tentative)  */
index 25d184b4d897b6bd6ca591e4482c950a2ddb80b5..2b5ff307a222da17e8439a0647a6c59f49fa1efe 100644 (file)
@@ -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)"