]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
close-device
authorJavier Sancho <jsf@jsancho.org>
Tue, 26 May 2020 06:38:12 +0000 (08:38 +0200)
committerJavier Sancho <jsf@jsancho.org>
Tue, 26 May 2020 06:38:12 +0000 (08:38 +0200)
irrlicht.scm
irrlicht/device.scm
src/device.cpp

index 69598fdd416f214524bcd440fc2762f2bac59c9e..24a3a132880a0fd88e6837932000198084f575f7 100644 (file)
@@ -81,6 +81,7 @@
                add-sphere-scene-node!
                add-static-text!
                begin-scene
+               close-device
                create-device
                create-fly-circle-animator
                create-fly-straight-animator
index ce97443ba1ee37a92a92c83c4e2e75e95d44e708..0fdeed7ffecad1484d7e473a6e497a87ed654f7e 100644 (file)
 (define-class <irrlicht-device> (<reference-counted>)
   (irr-class #:init-value "IrrlichtDevice"))
 
+(define-method (close-device (device <irrlicht-device>))
+  (let ((closeDevice (get-irrlicht-proc "closeDevice" device)))
+    (closeDevice device)))
+
 (define* (create-device #:key
                         (device-type 'software)
                         (window-size '(640 480))
   (let ((yield (get-irrlicht-proc "yield" device)))
     (yield device)))
 
-(export <irrlicht-device> create-device get-cursor-control get-file-system get-gui-environment
-        get-scene-manager get-timer get-video-driver is-window-active? run set-event-receiver!
-        set-resizable! set-window-caption! yield-device)
+(export <irrlicht-device> close-device create-device get-cursor-control get-file-system
+        get-gui-environment get-scene-manager get-timer get-video-driver is-window-active? run
+        set-event-receiver! set-resizable! set-window-caption! yield-device)
index dbd251cc390b65d733bae8416f38446383ff62a8..02edd859953a99f654dcb281ef9a96a03e83e6bb 100644 (file)
@@ -49,6 +49,13 @@ irr_createDevice (SCM device_type,
   return scm_from_irr_pointer ("<irrlicht-device>", (void*) device);
 }
 
+SCM
+IrrlichtDevice_closeDevice (SCM device)
+{
+  ((IrrlichtDevice*)scm_to_irr_pointer (device))->closeDevice ();
+  return SCM_UNSPECIFIED;
+}
+
 SCM
 IrrlichtDevice_getCursorControl (SCM device)
 {
@@ -151,6 +158,7 @@ void
 init_device (void)
 {
   DEFINE_GSUBR ("createDevice", 7, 0, 0, irr_createDevice);
+  DEFINE_GSUBR ("IrrlichtDevice_closeDevice", 1, 0, 0, IrrlichtDevice_closeDevice);
   DEFINE_GSUBR ("IrrlichtDevice_getCursorControl", 1, 0, 0, IrrlichtDevice_getCursorControl);
   DEFINE_GSUBR ("IrrlichtDevice_getFileSystem", 1, 0, 0, IrrlichtDevice_getFileSystem);
   DEFINE_GSUBR ("IrrlichtDevice_getGUIEnvironment", 1, 0, 0, IrrlichtDevice_getGUIEnvironment);