K3dTimer Class Reference

#include <K3dTimer.h>

Inheritance diagram for K3dTimer:

K3dScene List of all members.

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

K3dGameDatam_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.

Detailed Description

Definition at line 43 of file K3dTimer.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]

Definition at line 57 of file K3dTimer.h.

References m_fFps.

Referenced by K3dFontBmp::DrawFps().

unsigned int K3dTimer::GetNumFrames (  )  [inline]

Definition at line 62 of file K3dTimer.h.

References m_uiNumFrames.

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().


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Thu Aug 16 23:53:34 2007 for K3dEngine by  doxygen 1.5.0