From e3b7978afe8f8968242919e6e93c9a637233801a Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sat, 21 Mar 2020 20:18:58 +0100 Subject: [PATCH 1/1] is-window-active? yield --- src/device.cpp | 20 +++++++++++++++++++- src/device.h | 6 ++++++ 2 files changed, 25 insertions(+), 1 deletion(-) 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 -- 2.39.5