]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
run
authorJavier Sancho <jsf@jsancho.org>
Tue, 17 Mar 2020 08:22:14 +0000 (09:22 +0100)
committerJavier Sancho <jsf@jsancho.org>
Tue, 17 Mar 2020 08:22:14 +0000 (09:22 +0100)
examples/01.HelloWorld.scm
irrlicht/device.scm
src/device.cpp
src/device.h

index 31db92b4ad453bd0cd7b242a29c8742a082f78fe..8cbe11e1825105c2388ac834270dab0ea5c79ddd 100644 (file)
@@ -61,7 +61,7 @@
 (add-camera-scene-node! scene-manager #:position '(0 30 -40) #:lookat '(0 5 0))
 
 ;; draw everything
-(while (device-run? device)
+(while (run device)
   (begin-scene driver #:color '(255 100 101 140))
   (scene-draw-all scene-manager)
   (gui-draw-all gui-env)
index e07a812d2e0b6818473e2af7278f17dbb34dda9b..58d21279c3f4f926092e6e35c74c74d0abbe3b02 100644 (file)
@@ -23,6 +23,7 @@
             get-gui-environment
             get-scene-manager
             get-video-driver
+            run
             set-window-caption!))
 
 (load-extension "libguile-irrlicht" "init_guile_irrlicht")
index e578e057a9b04ac2f3857ca545f3a1ec54443636..a02cd0564f221c6b130285d813eeca0660f6b967 100644 (file)
@@ -35,6 +35,7 @@ extern "C" {
   {
     init_device_type ();
     scm_c_define_gsubr ("create-device", 7, 0, 0, (scm_t_subr)irr_createDevice);
+    scm_c_define_gsubr ("run", 1, 0, 0, (scm_t_subr)irr_run);
     scm_c_define_gsubr ("set-window-caption!", 2, 0, 0, (scm_t_subr)irr_setWindowCaption);
   }
 
@@ -61,6 +62,13 @@ extern "C" {
     return wrap_device (device);
   }
 
+  SCM
+  irr_run (SCM wrapped_device)
+  {
+    irr::IrrlichtDevice* device = unwrap_device (wrapped_device);
+    return scm_from_bool (device->run ());
+  }
+
   SCM
   irr_setWindowCaption (SCM wrapped_device,
                         SCM text)
index 8c9f8a167ca3915d0f7c6df6d20184c4e77e895e..5422b1fc65b3d458cf0d3576f620edcf419d7cbc 100644 (file)
@@ -43,6 +43,9 @@ extern "C" {
                     SCM vsync,
                     SCM receiver);
 
+  SCM
+  irr_run (SCM wrapped_device);
+
   SCM
   irr_setWindowCaption (SCM wrapped_device,
                         SCM text);