From: Alexis Laferrière Date: Sun, 27 Sep 2015 13:42:59 +0000 (-0400) Subject: lib/glesv2: intro a Makefile to automate wrapping X-Git-Tag: v0.7.8~2^2~2 X-Git-Url: http://nitlanguage.org lib/glesv2: intro a Makefile to automate wrapping Signed-off-by: Alexis Laferrière --- diff --git a/lib/glesv2/.gitignore b/lib/glesv2/.gitignore new file mode 100644 index 0000000..6f7cefe --- /dev/null +++ b/lib/glesv2/.gitignore @@ -0,0 +1 @@ +glesv2_stub.nit diff --git a/lib/glesv2/Makefile b/lib/glesv2/Makefile new file mode 100644 index 0000000..df29bb6 --- /dev/null +++ b/lib/glesv2/Makefile @@ -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