From 282fc1bc38d579d798250ee3c43d6bf0870e6e83 Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Mon, 9 Oct 2017 00:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=99=A8=E6=96=B0=E5=A2=9Ead?= =?UTF-8?q?dTimer=E9=87=8D=E8=BD=BD=E5=87=BD=E6=95=B0=EF=BC=8C=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=97=B6=E9=97=B4=E9=97=B4=E9=9A=94=E4=B8=BA20?= =?UTF-8?q?=E6=AF=AB=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Easy2D/Tool/Timer.cpp | 5 +++++ Easy2D/easy2d.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Easy2D/Tool/Timer.cpp b/Easy2D/Tool/Timer.cpp index 16ea3c60..b9b557d1 100644 --- a/Easy2D/Tool/Timer.cpp +++ b/Easy2D/Tool/Timer.cpp @@ -114,6 +114,11 @@ void Timer::addTimer(Timer * timer) s_vTimers.push_back(timer); } +void Timer::addTimer(TString name, const TIMER_CALLBACK & callback) +{ + addTimer(name, 20, callback); +} + void Timer::addTimer(TString name, UINT ms, const TIMER_CALLBACK & callback) { // 创建定时器 diff --git a/Easy2D/easy2d.h b/Easy2D/easy2d.h index 202082a7..214a6300 100644 --- a/Easy2D/easy2d.h +++ b/Easy2D/easy2d.h @@ -1487,6 +1487,8 @@ public: // 添加定时器 static void addTimer(Timer * timer); // 添加定时器 + static void addTimer(TString name, const TIMER_CALLBACK & callback); + // 添加定时器 static void addTimer(TString name, UINT ms, const TIMER_CALLBACK & callback); // 启动特定定时器 static void startTimer(TString name);