From: jsancho Date: Mon, 14 Dec 2009 19:30:26 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=862921d72ab5a90aee46074c40da8c0688a3a20d;p=gacela.git --- diff --git a/gacela.lisp b/gacela.lisp index 8a1c2c8..4501060 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -267,6 +267,7 @@ (do () ((quit?)) (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT)) (glLoadIdentity) +(gluLookAt 0 0 50 0 0 0 0 1 0) (when (functionp game-code) (funcall game-code)) (SDL_GL_SwapBuffers) (delay-frame) diff --git a/gacela_GL.lisp b/gacela_GL.lisp index e2032f8..ad71629 100644 --- a/gacela_GL.lisp +++ b/gacela_GL.lisp @@ -241,4 +241,4 @@ (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")) +(defentry gluLookAt (double double double double double double double double double) (void "gacela_gluLookAt")) diff --git a/gacela_draw.lisp b/gacela_draw.lisp index fd2a717..4b6f58f 100644 --- a/gacela_draw.lisp +++ b/gacela_draw.lisp @@ -17,10 +17,14 @@ (in-package :gacela) (defmacro with-color (color &body code) - `(let ((original-color (get-current-color))) - (apply #'set-current-color ,color) - ,@code - (apply #'set-current-color original-color))) + (cond (color + `(let ((original-color (get-current-color))) + (apply #'set-current-color ,color) + ,@code + (apply #'set-current-color original-color))) + (t + `(progn + ,@code)))) (defmacro progn-textures (&body code) `(let (values) @@ -105,7 +109,8 @@ (draw-rectangle (* f width) (* f height) :texture texture))))))) (defun draw-quad (v1 v2 v3 v4 &key texture) - (cond (texture + (cond ((consp texture) (with-color texture (draw v1 v2 v3 v4))) + (texture (progn-textures (glBindTexture GL_TEXTURE_2D (getf (get-resource texture) :id-texture)) (begin-draw 4)