]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
run and drop device
authorJavier Sancho <jsf@jsancho.org>
Fri, 4 Oct 2019 15:50:54 +0000 (17:50 +0200)
committerJavier Sancho <jsf@jsancho.org>
Fri, 4 Oct 2019 15:50:54 +0000 (17:50 +0200)
examples/hello.scm
irrlicht.scm
irrlicht/bindings.scm

index c8643b569c303ba1ba5cdc5f99dd6eee6e949501..cee3c64ff813554ad14b155fcf9316795f15e3a4 100644 (file)
@@ -25,3 +25,7 @@
 (define scene-manager (get-scene-manager device))
 
 (set-window-caption! device "Hello World!")
+
+(while (run? device))
+
+(drop! device)
index 6e7ccff6377958b42260471b1c6e64f599eee171..46332419678ddef82136512c10d2aaff3a5ac0f8 100644 (file)
@@ -27,7 +27,9 @@
   #:export (create-device
             get-video-driver
             get-scene-manager
-            set-window-caption!))
+            set-window-caption!
+            run?
+            drop!))
 
 (define* (create-device #:optional
                         (device-type 'software)
@@ -58,3 +60,9 @@
 
 (define (set-window-caption! device text)
   (ffi:set-window-caption device (string->pointer text)))
+
+(define (run? device)
+  (if (> (ffi:run device) 0) #t #f))
+
+(define (drop! device)
+  (if (> (ffi:drop device) 0) #t #f))
index 148a785304c6a0ff2b8c07a38b93b5aa1299f002..e54de96d5a3011df3e6ec37fa41cedd3ce61533b 100644 (file)
    void
    (dynamic-func "irr_IrrlichtDevice_setWindowCaption" cirr)
    (list '* '*)))
+
+(define-public run
+  (pointer->procedure
+   int
+   (dynamic-func "irr_IrrlichtDevice_run" cirr)
+   (list '*)))
+
+(define-public drop
+  (pointer->procedure
+   int
+   (dynamic-func "irr_IrrlichtDevice_drop" cirr)
+   (list '*)))