From df1ada6981c0c98038ba5fe2f09993934405dff2 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sun, 26 Apr 2020 19:40:25 +0200 Subject: [PATCH] set-event-receiver! --- src/device.cpp | 10 ++++++++++ src/device.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/device.cpp b/src/device.cpp index cb1e4a4..939685e 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -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) diff --git a/src/device.h b/src/device.h index 29bc783..ccf6482 100644 --- a/src/device.h +++ b/src/device.h @@ -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); -- 2.39.5