Window clear color and create window after tests

This commit is contained in:
BirDt_ 2026-03-29 17:22:51 +08:00
parent 7319c93cc0
commit 4f8ca4d97b
2 changed files with 20 additions and 12 deletions

View file

@ -5,6 +5,7 @@
(chicken sort)
raylib
(srfi 1)
(srfi 4)
(srfi 69)
(srfi 99)
(srfi 113)
@ -326,18 +327,7 @@
#f)))
;; Frame generation and game loop
(export resolve-queues next-frame)
;; Resolve the entity and system queues. This is exported which allows breaking iteration
(define (resolve-queues)
(resolve-entity-queue)
(resolve-system-queue))
;; Generate the next frame, for use in the main game loop
(define (next-frame)
(resolve-queues)
(with-drawing
execute-systems))
(export resolve-queues next-frame *clear-color*)
;; Utility function for guarding parameter values
(define (guarded-parameter default predicate)
@ -346,6 +336,22 @@
val
default))))
;; Resolve the entity and system queues. This is exported which allows breaking iteration
(define (resolve-queues)
(resolve-entity-queue)
(resolve-system-queue))
;; Clear color
(define *clear-color* (guarded-parameter RAYWHITE u8vector?))
;; Generate the next frame, for use in the main game loop
(define (next-frame)
(resolve-queues)
(with-drawing
(lambda ()
(clear-background (*clear-color*))
(execute-systems))))
;; Window creation
(export *window-size* *window-title* create-window)

View file

@ -82,4 +82,6 @@
(check (point-x (pop-event 'foo 'bar)) => 1) ;; Event is popped
(check (hash-table-size (fetch-event-bus 'foo)) => 0) ;; Event is removed exists
(create-window)
)