| 44 | } |
| 45 | |
| 46 | void FPS::update() |
| 47 | { |
| 48 | // Keep track of the time lapse and frame count |
| 49 | mFrames++; |
| 50 | mFrames2++; |
| 51 | |
| 52 | // Instant frame rate |
| 53 | PxReal Delta = PxReal(mTimer2.peekElapsedSeconds()); |
| 54 | if(Delta > 0.01f) |
| 55 | { |
| 56 | mInstantFPS = PxReal(mFrames2) / Delta; |
| 57 | mTimer2.getElapsedSeconds(); |
| 58 | mFrames2 = 0; |
| 59 | } |
| 60 | |
| 61 | // Update the frame rate once per second |
| 62 | Delta = PxReal(mTimer.peekElapsedSeconds()); |
| 63 | if(Delta > 1.0f) |
| 64 | { |
| 65 | mFPS = PxReal(mFrames) / Delta; |
| 66 | mTimer.getElapsedSeconds(); |
| 67 | mFrames = 0; |
| 68 | } |
| 69 | } |
nothing calls this directly
no test coverage detected