]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
set-event-receiver!
authorJavier Sancho <jsf@jsancho.org>
Sun, 26 Apr 2020 17:40:25 +0000 (19:40 +0200)
committerJavier Sancho <jsf@jsancho.org>
Sun, 26 Apr 2020 17:40:25 +0000 (19:40 +0200)
src/device.cpp
src/device.h

index cb1e4a4895724acc7d90999c54cdafd9226fd281..939685e025650efbdad3909c4823fea93144315a 100644 (file)
@@ -41,6 +41,7 @@ extern "C" {
     DEFINE_GSUBR ("get-timer", 1, 0, 0, irr_getTimer);
     DEFINE_GSUBR ("is-window-active?", 1, 0, 0, irr_isWindowActive);
     DEFINE_GSUBR ("run", 1, 0, 0, irr_run);
+    DEFINE_GSUBR ("set-event-receiver!", 2, 0, 0, irr_setEventReceiver);
     DEFINE_GSUBR ("set-resizable!", 2, 0, 0, irr_setResizable);
     DEFINE_GSUBR ("set-window-caption!", 2, 0, 0, irr_setWindowCaption);
     DEFINE_GSUBR ("yield", 1, 0, 0, irr_yield);
@@ -104,6 +105,15 @@ extern "C" {
     return scm_from_bool (device->run ());
   }
 
+  SCM
+  irr_setEventReceiver (SCM wrapped_device,
+                        SCM receiver)
+  {
+    irr::IrrlichtDevice* device = unwrap_device (wrapped_device);
+    device->setEventReceiver (unwrap_event_receiver (receiver));
+    return SCM_UNSPECIFIED;
+  }
+
   SCM
   irr_setResizable (SCM wrapped_device,
                     SCM resize)
index 29bc783f054d657a8c673b0d2ec38ddb7215808f..ccf6482a5196655c89f43705e2a48da3b3a3eb38 100644 (file)
@@ -46,6 +46,10 @@ extern "C" {
   SCM
   irr_run (SCM wrapped_device);
 
+  SCM
+  irr_setEventReceiver (SCM wrapped_device,
+                        SCM receiver);
+
   SCM
   irr_setResizable (SCM wrapped_device,
                     SCM resize);