From: jsancho Date: Wed, 26 Aug 2009 18:25:42 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;ds=sidebyside;h=b4bb1b1a7180f521bceb564003d906308f93b5b7;p=gacela.git --- diff --git a/gacela.lisp b/gacela.lisp index 62594b5..617ad3c 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -112,6 +112,8 @@ (glViewPort 0 0 width height) (glMatrixMode GL_PROJECTION) (glLoadIdentity) + (let* ((w (/ width 2)) (-w (neg w)) (h (/ height 2)) (-h (neg h))) + (glOrtho -w w -h h 0 1)) (gluPerspective 45 ratio 0.1 100) (glMatrixMode GL_MODELVIEW) (glLoadIdentity) diff --git a/gacela_GL.lisp b/gacela_GL.lisp index a14fa09..4ab7c88 100644 --- a/gacela_GL.lisp +++ b/gacela_GL.lisp @@ -170,6 +170,9 @@ (defcfun "void gacela_glBlendFunc (int sfactor, int dfactor)" 0 "glBlendFunc (sfactor, dfactor);") +(defcfun "void gacela_glOrtho (float left, float right, float bottom, float top, float near_val, float far_val)" 0 + "glOrtho (left, right, bottom, top, near_val, far_val);") + (defcfun "void gacela_gluPerspective (double fovy, double aspect, double zNear, double zFar)" 0 "gluPerspective (fovy, aspect, zNear, zFar);") @@ -201,6 +204,7 @@ (defentry glLightfv (int int float float float float) (void "gacela_glLightfv")) (defentry glNormal3f (float float float) (void "gacela_glNormal3f")) (defentry glBlendFunc (int int) (void "gacela_glBlendFunc")) +(defentry glOrtho (float float float float float float) (void "gacela_glOrtho")) (defentry gluPerspective (double double double double) (void "gacela_gluPerspective")) (defentry gluBuild2DMipmaps (int int int int int int int) (int "gacela_gluBuild2DMipmaps")) diff --git a/gacela_draw.lisp b/gacela_draw.lisp index 5e93e77..7a6dca6 100644 --- a/gacela_draw.lisp +++ b/gacela_draw.lisp @@ -57,7 +57,7 @@ (multiple-value-bind (texture width height) (load-texture filename) (cond (texture - (lambda (&optional (f 0.0172)) + (lambda (&optional (f 1)) (draw-rectangle (* f width) (* f height) :texture texture)))))) (defun draw-quad (v1 v2 v3 v4 &key texture color) diff --git a/gacela_tetris.lisp b/gacela_tetris.lisp index 3397a91..d43fb53 100644 --- a/gacela_tetris.lisp +++ b/gacela_tetris.lisp @@ -129,7 +129,7 @@ (setq next (random-tetramine))) (t (incf y) (start-timer timer))))) - (funcall background 0.086))) + (funcall background))) ; (translate -25 19) ; (draw-grid (join-grids tetramine grid x y)) ; (translate 40 40)