Guile agar
This commit is contained in:
32
agar/gui.scm
Normal file
32
agar/gui.scm
Normal 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 '*))))
|
||||
Reference in New Issue
Block a user