]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - src/device.cpp
get-timer get-time
[guile-irrlicht.git] / src / device.cpp
index f9c0d6a11247e2ebc703b2bcfbefb928094e38ee..96442c7e3797300654efd3964cb0901c94b3bdd8 100644 (file)
@@ -27,6 +27,7 @@
 #include "driver-types.h"
 #include "event-receiver.h"
 #include "gsubr.h"
+#include "timer.h"
 #include "wchar.h"
 #include "wrapped.h"
 
@@ -37,6 +38,7 @@ extern "C" {
   {
     init_device_type ();
     DEFINE_GSUBR ("create-device", 0, 0, 1, irr_createDevice);
+    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-window-caption!", 2, 0, 0, irr_setWindowCaption);
@@ -80,6 +82,13 @@ extern "C" {
     return wrap_device (device);
   }
 
+  SCM
+  irr_getTimer (SCM wrapped_device)
+  {
+    irr::IrrlichtDevice* device = unwrap_device (wrapped_device);
+    return wrap_timer (device->getTimer ());
+  }
+
   SCM
   irr_isWindowActive (SCM wrapped_device)
   {