add initial window

This commit is contained in:
2026-11-02 19:51:41 +03:00
parent 613ba3b7ee
commit 6003acd40c
2 changed files with 82 additions and 0 deletions

27
main.sex Normal file
View File

@@ -0,0 +1,27 @@
(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))