lib/glesv2: intro a Makefile to automate wrapping
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 27 Sep 2015 13:42:59 +0000 (09:42 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 28 Sep 2015 13:03:39 +0000 (09:03 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/glesv2/.gitignore [new file with mode: 0644]
lib/glesv2/Makefile [new file with mode: 0644]

diff --git a/lib/glesv2/.gitignore b/lib/glesv2/.gitignore
new file mode 100644 (file)
index 0000000..6f7cefe
--- /dev/null
@@ -0,0 +1 @@
+glesv2_stub.nit
diff --git a/lib/glesv2/Makefile b/lib/glesv2/Makefile
new file mode 100644 (file)
index 0000000..df29bb6
--- /dev/null
@@ -0,0 +1,9 @@
+# Generate basic Nit wrapper for glesv2, must be adapted by hands afterwards
+glesv2_stub.nit:
+       cat /usr/include/GLES2/gl2.h | sed \
+               -e "s/GL_APICALL void GL_APIENTRY \([^ ]*\) /fun \1 \`{ \1/" \
+               -e "s/GL_APICALL [^ ]* GL_APIENTRY \([^ ]*\) /fun \1: Int \`{ return \1/" \
+               -e "s/;/; \`}/" \
+               -e "s/#define GL_\([^ ]*\) .*/fun gl_\1: Int \`{ return GL_\1; \`}/" | grep fun > $@
+
+.PHONY: glesv2_stub.nit