;;; 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)))