From: Javier Sancho Date: Sun, 26 Apr 2020 17:40:25 +0000 (+0200) Subject: set-event-receiver! X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=df1ada6981c0c98038ba5fe2f09993934405dff2;p=guile-irrlicht.git set-event-receiver! --- 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);