]> git.jsancho.org Git - gacela.git/blobdiff - src/gacela.scm
(no commit message)
[gacela.git] / src / gacela.scm
index 38b57f01988a5eaa4642132db74711ca3b80a65c..f83e11737b920d59f2a64c670471edc8b4446a36 100644 (file)
   (glEnable GL_LIGHTING))
 
 (define (resize-screen-GL width height)
-  (glViewPort 0 0 width height)
+  (glViewport 0 0 width height)
   (glMatrixMode GL_PROJECTION)
   (glLoadIdentity)
   (cond ((3d-mode?) (let ((ratio (if (= height 0) width (/ width height))))
                      (gluPerspective 45 ratio 0.1 100))) ;0.1
-       (else (let* ((w (/ width 2)) (-w (neg w)) (h (/ height 2)) (-h (neg h)))
-               (glOrtho -w w -h h 0 1))))
+       (else (let* ((w (/ width 2)) (h (/ height 2)))
+               (glOrtho (- w) w (- h) h 0 1))))
   (glMatrixMode GL_MODELVIEW)
   (glLoadIdentity)
   #t)
 
 
 (define-macro (run-game . code)
-  `(let ((game-function (lambda () ,@code)))
+  `(let ((game-function (lambda () (begin ,@code))))
      (init-video-mode)
      (set-game-code game-function)
      (cond ((not (game-running?))
   (set! game-loop
        (lambda ()
          (set! running #t)
-         (do () ((quit?))
+;        (do () ((quit?))
+         (do () (#f)
            (init-frame-time)
-           (check-connections)
-           (eval-from-clients)
-           (process-events)
-           (cond ((not (quit?))
+;          (check-connections)
+;          (eval-from-clients)
+;          (process-events)
+;          (cond ((not (quit?))
+           (cond ((not #f)
                   (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
-                  (to-origin)
-                  (refresh-active-objects)
-                  (if (functionp game-code) (funcall game-code))
-                  (render-objects)
+;                (to-origin)
+;                (refresh-active-objects)
+                  (if (procedure? game-code) (game-code))
+;                (render-objects)
                   (SDL_GL_SwapBuffers)
                   (delay-frame))))
          (set! running #f)))