# Khaotic Engine Reborn: fps_class Class Reference

Loading...
Searching...
No Matches
fps_class Class Reference

## Public Member Functions

| fps_class (const fps_class &)
void | Initialize ()
void | Frame ()
int | GetFps ()
int | GetMinFps () const
int | GetMaxFps () const
float | GetFrameTime () const
void | ResetStats ()

## Detailed Description

Definition at line 20 of file fps_class.h.

## Constructor & Destructor Documentation

## fps_class() [1/2]

fps_class::fps_class | ( |  | ) |

Definition at line 4 of file fps_class.cpp.

{
}

## fps_class() [2/2]

fps_class::fps_class | ( | const fps_class & | other | ) |

Definition at line 9 of file fps_class.cpp.

{
}

## ~fps_class()

fps_class::~fps_class | ( |  | ) |

Definition at line 14 of file fps_class.cpp.

{
}

## Member Function Documentation

## Frame()

void fps_class::Frame | ( |  | ) |

Definition at line 31 of file fps_class.cpp.

{
unsigned int currentTime = timeGetTime();
m_frameTime = (currentTime - m_previousTime) * 0.001f;
m_previousTime = currentTime;
m_count++;
if (timeGetTime() >= (m_startTime + 1000))
{
m_fps = m_count;
if (m_fps < m_minFps)
m_minFps = m_fps;
if (m_fps > m_maxFps)
m_maxFps = m_fps;
m_count = 0;
m_startTime = timeGetTime();
}
return;
}

## GetFps()

int fps_class::GetFps | ( |  | ) |

Definition at line 79 of file fps_class.cpp.

{
return m_fps;
}

## GetFrameTime()

float fps_class::GetFrameTime | ( |  | ) | const

Definition at line 68 of file fps_class.cpp.

{
return m_frameTime;
}

## GetMaxFps()

int fps_class::GetMaxFps | ( |  | ) | const

Definition at line 63 of file fps_class.cpp.

{
return m_maxFps;
}

## GetMinFps()

int fps_class::GetMinFps | ( |  | ) | const

Definition at line 58 of file fps_class.cpp.

{
return m_minFps;
}

## Initialize()

void fps_class::Initialize | ( |  | ) |

Definition at line 18 of file fps_class.cpp.

{
m_fps = 0;
m_count = 0;
m_minFps = INT_MAX;
m_maxFps = 0;
m_frameTime = 0.0f;
m_previousTime = timeGetTime();
m_startTime = m_previousTime;
return;
}

## ResetStats()

void fps_class::ResetStats | ( |  | ) |

Definition at line 73 of file fps_class.cpp.

{
m_minFps = INT_MAX;
m_maxFps = 0;
}

The documentation for this class was generated from the following files:

- enginecustom/src/inc/system/fps_class.h
- enginecustom/src/src/system/fps_class.cpp