]> git.jsancho.org Git - gacela.git/blobdiff - src/gacela.scm
(no commit message)
[gacela.git] / src / gacela.scm
index ff28dbb6900f1ae7c574af0db8e0151a06317adf..569edc344d47c6d65af7912ca4efe9c7793500ae 100644 (file)
@@ -26,6 +26,7 @@
 ;;; SDL Initialization Subsystem
 
 (define init-sdl #f)
+(define sdl-on? #f)
 (define quit-sdl #f)
 
 (let ((initialized #f))
          (cond ((not initialized) (SDL_Init SDL_INIT_EVERYTHING) (set! initialized #t))
                (else initialized))))
 
+  (set! sdl-on?
+       (lambda ()
+         (if initialized #t #f)))
+
   (set! quit-sdl
        (lambda ()
          (SDL_Quit)
          (set! running #t)
          (quit? #f)
          (do () ((quit?))
-           (init-frame-time)
-;          (check-connections)
-;          (eval-from-clients)
-           (process-events)
-           (cond ((not (quit?))
-                  (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
-                  (to-origin)
-                  (cond ((mobs-changed?) (set! mobs (get-active-mobs))))
-                  (if (procedure? game-code) (game-code))
-                  (run-mob-actions mobs)
-                  (render-mobs mobs)
-                  (SDL_GL_SwapBuffers)
-                  (delay-frame))))
+           (if (sdl-on?) (init-frame-time))
+           (check-connections)
+           (eval-from-clients)
+           (cond ((sdl-on?)
+                  (process-events)
+                  (cond ((not (quit?))
+                         (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
+                         (to-origin)
+                         (cond ((mobs-changed?) (set! mobs (get-active-mobs))))
+                         (if (procedure? game-code) (game-code))
+                         (run-mob-actions mobs)
+                         (render-mobs mobs)
+                         (SDL_GL_SwapBuffers)
+                         (delay-frame))))))
          (set! running #f)))
 
   (set! game-running?