X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=gacela_GL.lisp;h=c293bf58cbb5739fe20c6a8de3db6e2e5a85b3b8;hb=377bf34ac61998549b24e339e3a3eea80734b6e3;hp=961a29a50688b8f74e25c52d0e756492742fd135;hpb=a559c9a47d17f1a7ca0a4dff3edcd39449d1821e;p=gacela.git diff --git a/gacela_GL.lisp b/gacela_GL.lisp index 961a29a..c293bf5 100644 --- a/gacela_GL.lisp +++ b/gacela_GL.lisp @@ -17,6 +17,16 @@ (in-package :gacela) +(defmacro mapcconst (type c-type name) + (let ((c-header (concatenate 'string c-type " gacela_" name " (void)")) + (c-body (concatenate 'string "return " name ";")) + (c-name (concatenate 'string "gacela_" name)) + (lisp-name (intern (string-upcase name)))) + `(progn + (defcfun ,c-header 0 ,c-body) + (defentry ,lisp-name () (,type ,c-name)) + (eval-when (load) (defconstant ,lisp-name (,lisp-name)))))) + (clines "#include ") (clines "#include ") @@ -152,6 +162,15 @@ "}" "return textures;") +(defcfun "void gacela_glDeleteTextures (int n, object textures)" 0 + "GLuint text[n];" + "int i, t;" + "for (i = 0; i < n; i++) {" + ((nth (int i) textures) t) + "text[i] = t;" + "}" + "glDeleteTextures (n, &text[0]);") + (defcfun "void gacela_glBindTexture (int target, int texture)" 0 "glBindTexture (target, texture);") @@ -207,6 +226,7 @@ (defentry glVertex3f (float float float) (void "gacela_glVertex3f")) (defentry glViewport (int int int int) (void "gacela_glViewport")) (defentry glGenTextures (int) (object "gacela_glGenTextures")) +(defentry glDeleteTextures (int object) (void "gacela_glDeleteTextures")) (defentry glBindTexture (int int) (void "gacela_glBindTexture")) (defentry glTexImage2D (int int int int int int int int int) (void "gacela_glTexImage2D")) (defentry glTexParameteri (int int int) (void "gacela_glTexParameteri"))