#include <K3dTimer.h>
Inheritance diagram for K3dTimer:
Public Member Functions | |
K3dTimer (K3dGameData *_pGameData) | |
~K3dTimer () | |
void | CalculateFPS () |
Calculate FPS. | |
bool | Wait (const int _iMsec) |
Wait some milliseconds. | |
float | GetFPS () |
unsigned int | GetNumFrames () |
void | SynchronizeSpeed (float &_fSpeed) |
Synchronize speed value for camera and object moving. | |
Private Attributes | |
K3dGameData * | m_pGameData |
Global game data, data centered game system. | |
float | m_fFps |
Actual FPS. | |
unsigned int | m_uiLastTime |
Previous frame time. | |
unsigned int | m_uiNumFrames |
Number of frames from game start. | |
unsigned int | m_uiWaitingTime |
Waiting time in milliseconds for wait fuction. |
Definition at line 43 of file K3dTimer.h.
K3dTimer::K3dTimer | ( | K3dGameData * | _pGameData | ) |
Definition at line 35 of file K3dTimer.cpp.
References m_fFps, m_pGameData, m_uiLastTime, m_uiNumFrames, m_uiWaitingTime, and K3dSceneData::SetTimer().
K3dTimer::~K3dTimer | ( | ) |
Definition at line 47 of file K3dTimer.cpp.
void K3dTimer::CalculateFPS | ( | ) |
Calculate FPS.
Return time in milisecond from initialization
Prevent dividing by zero
Definition at line 52 of file K3dTimer.cpp.
References m_fFps, m_uiLastTime, and m_uiNumFrames.
Referenced by K3dScene::Update().
bool K3dTimer::Wait | ( | const int | _iMsec | ) |
Wait some milliseconds.
Definition at line 70 of file K3dTimer.cpp.
References m_uiWaitingTime.
Referenced by K3dVM::Wait().
float K3dTimer::GetFPS | ( | ) | [inline] |
unsigned int K3dTimer::GetNumFrames | ( | ) | [inline] |
void K3dTimer::SynchronizeSpeed | ( | float & | _fSpeed | ) | [inline] |
Synchronize speed value for camera and object moving.
Definition at line 68 of file K3dTimer.h.
References K_DEFAULT_FPS, K_DEFAULT_SPEED, and m_fFps.
Referenced by K3dCamera::UpdateCamera().
K3dGameData* K3dTimer::m_pGameData [private] |
Global game data, data centered game system.
Reimplemented in K3dScene.
Definition at line 45 of file K3dTimer.h.
Referenced by K3dTimer().
float K3dTimer::m_fFps [private] |
Actual FPS.
Definition at line 46 of file K3dTimer.h.
Referenced by CalculateFPS(), GetFPS(), K3dTimer(), and SynchronizeSpeed().
unsigned int K3dTimer::m_uiLastTime [private] |
Previous frame time.
Definition at line 47 of file K3dTimer.h.
Referenced by CalculateFPS(), and K3dTimer().
unsigned int K3dTimer::m_uiNumFrames [private] |
Number of frames from game start.
Definition at line 48 of file K3dTimer.h.
Referenced by CalculateFPS(), GetNumFrames(), and K3dTimer().
unsigned int K3dTimer::m_uiWaitingTime [private] |
Waiting time in milliseconds for wait fuction.
Definition at line 49 of file K3dTimer.h.
Referenced by K3dTimer(), and Wait().