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 00024 #ifndef __ze_ztimer_h__ 00025 #define __ze_ztimer_h__ 00026 00027 #include "ZE_ZEngine.h" 00028 00029 namespace ZE 00030 { 00031 00037 class ZTimer 00038 { 00039 protected: 00041 ZEngine* rEngine; 00043 bool rPaused; 00045 bool rUseZEngine; 00047 Uint32 rPausedTime; 00049 Uint32 rLastPause; 00050 00057 Uint32 GetParentTime() const; 00058 00059 public: 00060 00067 ZTimer(bool useZEngine=true); 00068 00074 virtual ~ZTimer(); 00075 00081 void Reset(); 00082 00088 void Pause(); 00089 00095 void Unpause(); 00096 00103 Uint32 GetTime() const; 00104 00111 bool IsPaused() const; 00112 }; 00113 00114 } 00115 00116 #endif //__ze_ztimer_h__