X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Ftimer.cpp;fp=src%2Ftimer.cpp;h=0022f1060fe2f7928d6313565615568ec825ffba;hb=56bdd24ab9463c0bba4d5be87b2933e6a817ccee;hp=0000000000000000000000000000000000000000;hpb=26bfba9849221399127c93fe557c7877b523ec94;p=guile-irrlicht.git diff --git a/src/timer.cpp b/src/timer.cpp new file mode 100644 index 0000000..0022f10 --- /dev/null +++ b/src/timer.cpp @@ -0,0 +1,48 @@ +/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine + + Copyright (C) 2020 Javier Sancho + + This file is part of guile-irrlicht. + + guile-irrlicht is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of the + License, or (at your option) any later version. + + guile-irrlicht is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with guile-irrlicht. If not, see + . +*/ + +#include +#include + +#include "gsubr.h" +#include "timer.h" +#include "wrapped.h" + +extern "C" { + + void + init_timer (void) + { + init_timer_type (); + DEFINE_GSUBR ("get-time", 1, 0, 0, irr_getTime); + } + + DEFINE_WRAPPED_TYPE (irr::ITimer*, "timer", + init_timer_type, timer_p, + wrap_timer, unwrap_timer); + + SCM + irr_getTime (SCM wrapped_timer) + { + return scm_from_uint32 (unwrap_timer (wrapped_timer)->getTime()); + } + +}