OpenLayer Offline Manual

OpenLayer | FpsCounter | Start Start
static void Start( | float defaultFps );
Start the fps counter. defaultFps is the fps you're planning the game to run in. This function should be called right before the game loop starts. Note that the speed regulation requires you to multiply all speed and position and rotational changes with the delta time. For an example of how to do this see the definition of FpsCounter. Note that the actual fps you get may differ a lot from the defaultFps. You can set the default fps to be 70.0 and get 500 fps. But it makes planning the game easier as you can design the speeds and accelerations of the game objects only related to the default fps, not to the actual fps the game runs in. So you could choose the default fps to be 100.0 and set the speed of an object to 0.05 or to choose the default fps to be 50.0 and set the speed of the object to be 0.10. In both cases the game will run exactly the same way. Examples // Start the fps counter such that the choosen default fps is 70.0 // // (The actual fps can be several hundreds but the objects still appear to move // // at the same speed as if the fps was 70.0, but only far more accurately) // FpsCounter::Start( 70.0 ); Other functions of the class FpsCounter
Start | Starts the FPS counter
NewFrameStarted | Tells OpenLayer that a new game frame has started
GetDeltaTime | Get the elapsed game time between this and the previous frame
GetFps | Returns the frames per second the program runs at
Pause | Pauses the FPS counter
Resume | Resumes the paused FPS counter
Back to the main page of the manual Questions about Start? Click here.