From 0471cb27d989e74c5b6b3660853caf2872569f8f Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Tue, 17 Mar 2020 09:22:14 +0100 Subject: [PATCH] run --- examples/01.HelloWorld.scm | 2 +- irrlicht/device.scm | 1 + src/device.cpp | 8 ++++++++ src/device.h | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/01.HelloWorld.scm b/examples/01.HelloWorld.scm index 31db92b..8cbe11e 100644 --- a/examples/01.HelloWorld.scm +++ b/examples/01.HelloWorld.scm @@ -61,7 +61,7 @@ (add-camera-scene-node! scene-manager #:position '(0 30 -40) #:lookat '(0 5 0)) ;; draw everything -(while (device-run? device) +(while (run device) (begin-scene driver #:color '(255 100 101 140)) (scene-draw-all scene-manager) (gui-draw-all gui-env) diff --git a/irrlicht/device.scm b/irrlicht/device.scm index e07a812..58d2127 100644 --- a/irrlicht/device.scm +++ b/irrlicht/device.scm @@ -23,6 +23,7 @@ get-gui-environment get-scene-manager get-video-driver + run set-window-caption!)) (load-extension "libguile-irrlicht" "init_guile_irrlicht") diff --git a/src/device.cpp b/src/device.cpp index e578e05..a02cd05 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -35,6 +35,7 @@ extern "C" { { init_device_type (); scm_c_define_gsubr ("create-device", 7, 0, 0, (scm_t_subr)irr_createDevice); + 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); } @@ -61,6 +62,13 @@ extern "C" { return wrap_device (device); } + SCM + irr_run (SCM wrapped_device) + { + irr::IrrlichtDevice* device = unwrap_device (wrapped_device); + return scm_from_bool (device->run ()); + } + SCM irr_setWindowCaption (SCM wrapped_device, SCM text) diff --git a/src/device.h b/src/device.h index 8c9f8a1..5422b1f 100644 --- a/src/device.h +++ b/src/device.h @@ -43,6 +43,9 @@ extern "C" { SCM vsync, SCM receiver); + SCM + irr_run (SCM wrapped_device); + SCM irr_setWindowCaption (SCM wrapped_device, SCM text); -- 2.39.5