X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=gacela_GL.lisp;h=b890c25a2f96058e13903a372bb97ac25d3c7910;hb=00abf12486704814b6aa12d8b162135df6637141;hp=8b532f33e7f3a21022e8cfe76081d074f9e20eda;hpb=90f83164ea36dae4c0f3370f8ebbf7e30fe83297;p=gacela.git diff --git a/gacela_GL.lisp b/gacela_GL.lisp index 8b532f3..b890c25 100644 --- a/gacela_GL.lisp +++ b/gacela_GL.lisp @@ -15,7 +15,20 @@ ;;; along with this program. If not, see . -(in-package :gacela) +(eval-when (compile load eval) + (when (not (find-package 'gacela)) (make-package 'gacela :nicknames '(gg) :use '(lisp))) + (in-package 'gacela :nicknames '(gg) :use '(lisp))) + + +(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 ") @@ -196,6 +209,9 @@ (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")) @@ -228,3 +244,4 @@ (defentry gluPerspective (double double double double) (void "gacela_gluPerspective")) (defentry gluBuild2DMipmaps (int int int int int int int) (int "gacela_gluBuild2DMipmaps")) +(defentry gluLookAt (double double double double double double double double double) (void "gacela_gluLookAt"))