-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDebug.cpp
More file actions
47 lines (40 loc) · 964 Bytes
/
Copy pathDebug.cpp
File metadata and controls
47 lines (40 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "stdafx.h"
#include "Debug.h"
DebugEngine gDebug;
DebugEngine::DebugEngine()
: mDrawUiBounds()
, mFPSCounterMin(1000)
, mFPSCounterMax()
, mDrawSceneAabbTree()
, mNoDrawWaterLava()
, mNoDrawSceneObjects()
, mDrawPhysics()
{
}
void DebugEngine::Initialize()
{
mFPSDeltaTimeAccumulator = 0.0f;
mFPSCounter = 0;
mFPSCounterLast = 0;
mFPSCounterMin = 1000;
mFPSCounterMax = 0;
}
void DebugEngine::Shutdown()
{
}
void DebugEngine::UpdateFrame()
{
// process fps
mFPSDeltaTimeAccumulator += gTime.GetFrameDelta(eGameClock::Realtime);
++mFPSCounter;
if (mFPSDeltaTimeAccumulator >= 1.0f)
{
mFPSDeltaTimeAccumulator -= 1.0f;
mFPSCounterLast = mFPSCounter;
if (mFPSCounterLast > mFPSCounterMax)
mFPSCounterMax = mFPSCounterLast;
if (mFPSCounterLast < mFPSCounterMin)
mFPSCounterMin = mFPSCounterLast;
mFPSCounter = 0;
}
}