From: Javier Sancho Date: Sat, 21 Mar 2020 19:18:58 +0000 (+0100) Subject: is-window-active? yield X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=e3b7978afe8f8968242919e6e93c9a637233801a;hp=fd10e89f595a8ae45d4471a7d77426d0a1b77502;p=guile-irrlicht.git is-window-active? yield --- diff --git a/src/device.cpp b/src/device.cpp index 3b5b9b9..41d6193 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -35,9 +35,12 @@ extern "C" { { 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_export ("create-device", "run", "set-window-caption!", NULL); + 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_WRAPPED_TYPE (irr::IrrlichtDevice*, "device", @@ -76,6 +79,13 @@ extern "C" { return wrap_device (device); } + SCM + irr_isWindowActive (SCM wrapped_device) + { + irr::IrrlichtDevice* device = unwrap_device (wrapped_device); + return scm_from_bool (device->isWindowActive ()); + } + SCM irr_run (SCM wrapped_device) { @@ -92,4 +102,12 @@ extern "C" { return SCM_UNSPECIFIED; } + SCM + irr_yield (SCM wrapped_device) + { + irr::IrrlichtDevice* device = unwrap_device (wrapped_device); + device->yield (); + return SCM_UNSPECIFIED; + } + } diff --git a/src/device.h b/src/device.h index 31195c6..ec5875a 100644 --- a/src/device.h +++ b/src/device.h @@ -37,6 +37,9 @@ extern "C" { SCM irr_createDevice (SCM rest); + SCM + irr_isWindowActive (SCM wrapped_device); + SCM irr_run (SCM wrapped_device); @@ -44,6 +47,9 @@ extern "C" { irr_setWindowCaption (SCM wrapped_device, SCM text); + SCM + irr_yield (SCM wrapped_device); + } #endif