From 5293bb782051f9bfea3802151acb0c8644c98104 Mon Sep 17 00:00:00 2001 From: jsancho Date: Thu, 27 Aug 2009 17:36:57 +0000 Subject: [PATCH] --- gacela.lisp | 4 +--- gacela_GL.lisp | 4 ++++ gacela_draw.lisp | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gacela.lisp b/gacela.lisp index 617ad3c..efdeb60 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -25,7 +25,6 @@ (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) @@ -92,7 +91,7 @@ (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) @@ -357,7 +356,6 @@ (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*))) diff --git a/gacela_GL.lisp b/gacela_GL.lisp index 4ab7c88..bce7813 100644 --- a/gacela_GL.lisp +++ b/gacela_GL.lisp @@ -126,6 +126,9 @@ (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);") @@ -194,6 +197,7 @@ (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")) diff --git a/gacela_draw.lisp b/gacela_draw.lisp index 7a6dca6..364163b 100644 --- a/gacela_draw.lisp +++ b/gacela_draw.lisp @@ -17,6 +17,8 @@ (in-package :gacela) +(defmacro set-dimension (&key 2d 3d)) + (defun draw (&rest vertexes) (begin-draw (length vertexes)) (draw-vertexes vertexes) @@ -32,7 +34,7 @@ (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)))) -- 2.39.2