00001 /******************************************************************************* 00002 This file is Part of the ZEngine Library for 2D game development. 00003 Copyright (C) 2002, 2003 James Turk 00004 00005 Licensed under a BSD-style license. 00006 00007 The maintainer of this library is James Turk (james@conceptofzero.net) 00008 and the home of this Library is http://www.zengine.sourceforge.net 00009 *******************************************************************************/ 00010 00020 #ifndef __ze_ztimer_h__ 00021 #define __ze_ztimer_h__ 00022 00023 #include "ZE_ZEngine.h" 00024 00025 namespace ZE 00026 { 00027 00033 class ZTimer 00034 { 00035 protected: 00037 ZEngine* rEngine; 00039 bool rPaused; 00041 bool rUseZEngine; 00043 Uint32 rPausedTime; 00045 Uint32 rLastPause; 00046 00053 Uint32 GetParentTime() const; 00054 00055 public: 00056 00063 ZTimer(bool useZEngine=true); 00064 00070 virtual ~ZTimer(); 00071 00077 void Reset(); 00078 00084 void Pause(); 00085 00091 void Unpause(); 00092 00099 Uint32 GetTime() const; 00100 00107 bool IsPaused() const; 00108 }; 00109 00110 } 00111 00112 #endif //__ze_ztimer_h__