add initial window
This commit is contained in:
27
main.sex
Normal file
27
main.sex
Normal 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))
|
||||
Reference in New Issue
Block a user