#include <fpstimer.h>
Public Member Functions | |
| FPSTimer () | |
| Constructor. | |
| void | setFPSLock (double fps) |
| Set the fps to lock the frame rate to; used in delay(). | |
| void | setLastFrame (int ticks) |
| Set the time that the last frame was drawn. | |
| double | deltaSeconds (int ticks1, int ticks2) |
| Calculate delta in seconds between two sets of ticks. | |
| void | delay () |
| Delay the engine until the locked FPS rate is reached. | |
Private Attributes | |
| int | m_LastFrame |
| The last time a frame was drawn. | |
| double | m_FPSLock |
| Rate of FPS to lock. | |
Since not all computers run graphics games at equal speeds, this class is responsible for keeping the frame rate at a reasonable level
| void FPSTimer::setFPSLock | ( | double | fps | ) | [inline] |
| void FPSTimer::setLastFrame | ( | int | ticks | ) | [inline] |
Set the time that the last frame was drawn.
| ticks | Last frame's drawing time |
| double FPSTimer::deltaSeconds | ( | int | ticks1, | |
| int | ticks2 | |||
| ) |
Calculate delta in seconds between two sets of ticks.
| ticks1 | The first tick count | |
| ticks2 | The second tick count |
1.5.3