X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fdevice.cpp;h=b60ec44e4681b3e4f0572833a402f904dc9fe62b;hb=db41186ef83fe5def23e3eacfbcea9248adf700e;hp=41d6193344190efb3fc45c536a513a82308d09fd;hpb=e3b7978afe8f8968242919e6e93c9a637233801a;p=guile-irrlicht.git diff --git a/src/device.cpp b/src/device.cpp index 41d6193..b60ec44 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -25,6 +25,8 @@ #include "device.h" #include "dimension2d.h" #include "driver-types.h" +#include "event-receiver.h" +#include "gsubr.h" #include "wchar.h" #include "wrapped.h" @@ -34,13 +36,11 @@ extern "C" { init_device (void) { init_device_type (); - scm_c_define_gsubr ("create-device", 0, 0, 1, (scm_t_subr)irr_createDevice); - scm_c_define_gsubr ("is-window-active?", 1, 0, 0, (scm_t_subr)irr_isWindowActive); - 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); - scm_c_define_gsubr ("yield", 1, 0, 0, (scm_t_subr)irr_yield); - scm_c_export ("create-device", "is-window-active?", "run", - "set-window-caption!", "yield", NULL); + DEFINE_GSUBR ("create-device", 0, 0, 1, irr_createDevice); + DEFINE_GSUBR ("is-window-active?", 1, 0, 0, irr_isWindowActive); + DEFINE_GSUBR ("run", 1, 0, 0, irr_run); + DEFINE_GSUBR ("set-window-caption!", 2, 0, 0, irr_setWindowCaption); + DEFINE_GSUBR ("yield", 1, 0, 0, irr_yield); } DEFINE_WRAPPED_TYPE (irr::IrrlichtDevice*, "device", @@ -75,7 +75,8 @@ extern "C" { scm_to_uint32 (bits), scm_to_bool (fullscreen), scm_to_bool (stencilbuffer), - scm_to_bool (vsync)); + scm_to_bool (vsync), + scm_is_false (receiver) ? 0 : unwrap_event_receiver (receiver)); return wrap_device (device); }