]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - irrlicht/device.scm
Generic function for unwrapping foreign records
[guile-irrlicht.git] / irrlicht / device.scm
index 928a6c8e51cf362b2506c430cf2825b623f8479c..c773dbc99d96af6fc5fc027c06dbe32788057228 100644 (file)
@@ -22,8 +22,8 @@
   #:use-module (ice-9 match)
   #:use-module (system foreign)
   #: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 dimension2d)
   #:use-module (irrlicht util)
   #:export (create-device
             get-cursor-control
@@ -38,7 +38,7 @@
 
 (define* (create-device #:key
                         (device-type 'software)
-                        (window-size '(640 480))
+                        (window-size (make-dimension2d 640 480))
                         (bits 16)
                         (fullscreen #f)
                         (stencilbuffer #f)
                        ('direct3d8 ffi-video:EDT_DIRECT3D8)
                        ('direct3d9 ffi-video:EDT_DIRECT3D9)
                        ('opengl ffi-video:EDT_OPENGL)
-                       ('count ffi-video:EDT_COUNT)))
-        (wsize (make-c-struct ffi-core:dimension2d window-size)))
-    (let ((device (ffi:create-device driver wsize bits
+                       ('count ffi-video:EDT_COUNT))))
+    (let ((device (ffi:create-device driver
+                                     (foreign-record->pointer window-size)
+                                     bits
                                      (bool->integer fullscreen)
                                      (bool->integer stencilbuffer)
                                      (bool->integer vsync))))