(defvar *gacela-freq* 30)
(defvar *transparent-color* '(:red 0 :green 0 :blue 0))
(defvar *background-color* '(:red 0 :green 0 :blue 0))
-(defvar *zoom* -10)
;;; SDL Initialization Subsystem
(let (initialized)
(glShadeModel GL_SMOOTH)
(glClearColor 0 0 0 0)
(glClearDepth 1)
- (glEnable GL_DEPTH_TEST)
+ (glDisable GL_DEPTH_TEST)
(glDepthFunc GL_LEQUAL)
; (glEnable GL_BLEND)
; (glBlendFunc GL_SRC_ALPHA GL_ONE)
(do () ((quit?))
(glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
(glLoadIdentity)
- (translate 0 0 *zoom*)
,@code
(SDL_GL_SwapBuffers)
(SDL_Delay (- *gacela-freq* (rem (SDL_GetTicks) *gacela-freq*)))
(defcfun "void gacela_glTranslatef (float x, float y, float z)" 0
"glTranslatef (x, y, z);")
+(defcfun "void gacela_glVertex2f (float x, float y)" 0
+ "glVertex2f (x, y);")
+
(defcfun "void gacela_glVertex3f (float x, float y, float z)" 0
"glVertex3f (x, y, z);")
(defentry glRotatef (float float float float) (void "gacela_glRotatef"))
(defentry glShadeModel (int) (void "gacela_glShadeModel"))
(defentry glTranslatef (float float float) (void "gacela_glTranslatef"))
+(defentry glVertex2f (float float) (void "gacela_glVertex2f"))
(defentry glVertex3f (float float float) (void "gacela_glVertex3f"))
(defentry glViewport (int int int int) (void "gacela_glViewport"))
(defentry glGenTextures (int) (object "gacela_glGenTextures"))
(in-package :gacela)
+(defmacro set-dimension (&key 2d 3d))
+
(defun draw (&rest vertexes)
(begin-draw (length vertexes))
(draw-vertexes vertexes)
(draw-vertexes (cdr vertexes)))))
(defun draw-vertex (vertex &key texture-coord)
- (cond ((consp (car vertex)) (apply #'glColor3f (car vertex)) (apply #'glVertex3f (cadr vertex)))
+ (cond ((consp (car vertex)) (draw-color (car vertex)) (apply #'glVertex3f (cadr vertex)))
(t (cond (texture-coord (apply #'glTexCoord2f texture-coord)))
(apply #'glVertex3f vertex))))