compteur de fps
This commit is contained in:
46
enginecustom/fpsclass.cpp
Normal file
46
enginecustom/fpsclass.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#include "fpsclass.h"
|
||||
|
||||
|
||||
FpsClass::FpsClass()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
FpsClass::FpsClass(const FpsClass& other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
FpsClass::~FpsClass()
|
||||
{
|
||||
}
|
||||
|
||||
void FpsClass::Initialize()
|
||||
{
|
||||
m_fps = 0;
|
||||
m_count = 0;
|
||||
|
||||
m_startTime = timeGetTime();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void FpsClass::Frame()
|
||||
{
|
||||
m_count++;
|
||||
|
||||
if (timeGetTime() >= (m_startTime + 1000))
|
||||
{
|
||||
m_fps = m_count;
|
||||
m_count = 0;
|
||||
|
||||
m_startTime = timeGetTime();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int FpsClass::GetFps()
|
||||
{
|
||||
return m_fps;
|
||||
}
|
||||
Reference in New Issue
Block a user