]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - irrlicht/device.scm
Boolean functions
[guile-irrlicht.git] / irrlicht / device.scm
index 9a009ef2cd13f8d5cd3fde000533f10e228a3d1c..928a6c8e51cf362b2506c430cf2825b623f8479c 100644 (file)
@@ -24,6 +24,7 @@
   #:use-module ((irrlicht bindings) #:prefix ffi:)
   #:use-module ((irrlicht bindings core) #:prefix ffi-core:)
   #:use-module ((irrlicht bindings video) #:prefix ffi-video:)
+  #:use-module (irrlicht util)
   #:export (create-device
             get-cursor-control
             get-file-system
@@ -52,9 +53,9 @@
                        ('count ffi-video:EDT_COUNT)))
         (wsize (make-c-struct ffi-core:dimension2d window-size)))
     (let ((device (ffi:create-device driver wsize bits
-                                     (if fullscreen 1 0)
-                                     (if stencilbuffer 1 0)
-                                     (if vsync 1 0))))
+                                     (bool->integer fullscreen)
+                                     (bool->integer stencilbuffer)
+                                     (bool->integer vsync))))
       (if (null-pointer? device) #f device))))
 
 (define (get-cursor-control device)
   (ffi:get-scene-manager device))
 
 (define (is-window-active? device)
-  (if (> (ffi:is-window-active device) 0) #t #f))
+  (integer->bool (ffi:is-window-active device)))
 
 (define (set-window-caption! device text)
   (ffi:set-window-caption device (string->pointer text)))
 
 (define (device-run? device)
-  (if (> (ffi:run device) 0) #t #f))
+  (integer->bool (ffi:run device)))
 
 (define (device-drop! device)
-  (if (> (ffi:drop device) 0) #t #f))
+  (integer->bool (ffi:drop device)))