]> git.jsancho.org Git - gacela.git/blobdiff - gacela_GL.lisp
(no commit message)
[gacela.git] / gacela_GL.lisp
index 8b532f33e7f3a21022e8cfe76081d074f9e20eda..e2032f817609355a9020ac74dbbd9d2dc4353adf 100644 (file)
 
 (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 <GL/gl.h>")
 (clines "#include <GL/glu.h>")
 
 (defcfun "int gacela_gluBuild2DMipmaps (int target, int internalFormat, int width, int height, int format, int type, int data)" 0
   "return gluBuild2DMipmaps (target, internalFormat, width, height, format, type, data);")
 
+(defcfun "void gacela_gluLookAt (double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ)" 0
+  "gluLookAt (eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ);")
+
 (defentry glBegin (int) (void "gacela_glBegin"))
 (defentry glClear (int) (void "gacela_glClear"))
 (defentry glClearColor (float float float float) (void "gacela_glClearColor"))
 
 (defentry gluPerspective (double double double double) (void "gacela_gluPerspective"))
 (defentry gluBuild2DMipmaps (int int int int int int int) (int "gacela_gluBuild2DMipmaps"))
+(defentry gluLookAt (float float float float float float float float float) (void "gacela_gluLookAt"))