28 lines
803 B
Scheme
28 lines
803 B
Scheme
(include raylib.h)
|
|
|
|
(define WIN-WIDTH 1440)
|
|
(define WIN-HEIGHT 900)
|
|
|
|
(defmacro (call-and-check test msg code fn . args)
|
|
`(do
|
|
(,fn ,@args)
|
|
(if (! (,test))
|
|
(do
|
|
(TraceLog LOG-ERROR ,msg)
|
|
(return ,code)))))
|
|
|
|
(pub fn main ((argc int) (argv [* const char])) int
|
|
(TraceLog LOG-INFO "hello from Catch-Phase! initializing resources...")
|
|
(call-and-check IsWindowReady "failed to create window" 1
|
|
InitWindow WIN-WIDTH WIN-HEIGHT "Catch-Phase")
|
|
(call-and-check IsAudioDeviceReady "failed to init audio" 2
|
|
InitAudioDevice)
|
|
(while (! (WindowShouldClose))
|
|
(BeginDrawing)
|
|
(ClearBackground BLACK)
|
|
(DrawCircle (/ WIN-WIDTH 2) (/ WIN-HEIGHT 2) 100.0f RAYWHITE)
|
|
(EndDrawing))
|
|
(CloseAudioDevice)
|
|
(CloseWindow)
|
|
(return 0))
|