(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)
(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"))
(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)
(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)