]> git.jsancho.org Git - gacela.git/blobdiff - src/gacela.scm
(no commit message)
[gacela.git] / src / gacela.scm
index ff28dbb6900f1ae7c574af0db8e0151a06317adf..aeea861a222d133e94202fe1eca3efd1ea0401a9 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)
 
 ;;; GaCeLa Functions
 
-(define (init-gacela)
-  (init-sdl)
-  (init-gl))
-
-
 (define set-frames-per-second #f)
 (define init-frame-time #f)
 (define delay-frame #f)
        (lambda ()
          (set! mobs (get-active-mobs))
          (set! running #t)
-         (quit? #f)
+         (quit! #f)
          (do () ((quit?))
            (init-frame-time)
-;          (check-connections)
-;          (eval-from-clients)
+           (check-connections)
+           (eval-from-clients)
            (process-events)
            (cond ((not (quit?))
-                  (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
-                  (to-origin)
+                  (cond ((video-mode-on?)
+                         (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)
+                  (cond ((video-mode-on?)
+                         (render-mobs mobs)
+                         (SDL_GL_SwapBuffers)))
                   (delay-frame))))
          (set! running #f)))