Guile agar

This commit is contained in:
2026-03-31 19:52:07 -05:00
commit 4ea0e7933e
6 changed files with 93 additions and 0 deletions

32
agar/gui.scm Normal file
View File

@@ -0,0 +1,32 @@
(define-module (agar gui)
#:use-module (agar util)
#:use-module (system foreign)
#:use-module (system foreign-library)
#:export (init-graphics
window-new &window-main window-show
label-new))
(define* (init-graphics #:optional (drivers #f))
((with-string-inputs '(0)
(foreign-library-function "libag_gui" "AG_InitGraphics"
#:return-type int
#:arg-types (list '*)))
drivers))
(define window-new
(foreign-library-function "libag_gui" "AG_WindowNew"
#:return-type '*
#:arg-types (list unsigned-int)))
(define &window-main #x10000)
(define window-show
(foreign-library-function "libag_gui" "AG_WindowShow"
#:return-type void
#:arg-types (list '*)))
(define label-new
(with-string-inputs '(2)
(foreign-library-function "libag_gui" "AG_LabelNew"
#:return-type '*
#:arg-types (list '* unsigned-int '*))))