]> git.jsancho.org Git - gacela.git/blobdiff - gacela.lisp
(no commit message)
[gacela.git] / gacela.lisp
index cc875b4c8109fb082ed818ed53757ca90f9fe3c0..c6cdeb9f57e7d5b6a94c1f12c60eff2a4ffca441 100644 (file)
      (init-video-mode)
      (set-game-code game-function)
      (cond ((not (game-running?))
-           (init-frame-time)
-           (process-events)
            (game-loop)))))
 
 (let (running game-code)
   (defun game-loop ()
     (setq running t)
     (do () ((quit?))
-       (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
-       (to-origin)
-       (refresh-visible-boxes)
-       (when (functionp game-code) (funcall game-code))
-       (render-boxes)
-       (SDL_GL_SwapBuffers)
-       (delay-frame)
        (init-frame-time)
        (check-connections)
        (eval-from-clients)
-       (process-events))
+       (process-events)
+       (cond ((not (quit?))
+              (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
+              (to-origin)
+              (refresh-visible-boxes)
+              (when (functionp game-code) (funcall game-code))
+              (render-boxes)
+              (SDL_GL_SwapBuffers)
+              (delay-frame))))
     (setq running nil))
 
   (defun game-running? ()