1 // GlobalTimer.cpp: implementation of the CGlobalTimer class.
\r
3 //////////////////////////////////////////////////////////////////////
\r
6 #include "GlobalTimer.h"
\r
8 //////////////////////////////////////////////////////////////////////
\r
9 // Construction/Destruction
\r
10 //////////////////////////////////////////////////////////////////////
\r
12 float CGlobalTimer::dT=0;
\r
13 unsigned long CGlobalTimer::lastFrameIndex=0;
\r
14 unsigned long CGlobalTimer::thisFrameIndex=0;
\r
16 CGlobalTimer::CGlobalTimer()
\r
21 CGlobalTimer::~CGlobalTimer()
\r
26 bool CGlobalTimer::Start()
\r
28 thisFrameIndex=GetTickCount();
\r
29 lastFrameIndex=thisFrameIndex;
\r
34 void CGlobalTimer::Update()
\r
36 lastFrameIndex=thisFrameIndex;
\r
37 thisFrameIndex=GetTickCount();
\r
38 dT=((float)(thisFrameIndex-lastFrameIndex))/1000.0f;
\r
41 void CGlobalTimer::Stop()
\r