Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Class TFramesPerSecond
Unit
CastleTimeUtils
Declaration
type TFramesPerSecond = class(TObject)
Description
Utility to measure frames per second, independent of actual rendering API. For example, it can be easily "plugged" into TCastleWindowBase (see TCastleWindowBase.FPS) or Lazarus GL control (see TCastleControlCustom.FPS).
Things named "_" here are supposed to be internal to the TCastleWindowBase / TCastleControlCustom and such implementations. Other properties can be controlled by the user of TCastleWindowBase / TCastleControlCustom.
Hierarchy
Overview
Methods
Properties
Description
Methods
 |
constructor Create; |
|
 |
procedure _RenderBegin; |
|
 |
procedure _RenderEnd; |
|
 |
procedure _UpdateBegin; |
|
Properties
 |
property FrameTime: Double read FFrameTime; |
Rendering speed in frames per second. This tells FPS, if we would only call Draw (EventDraw, OnDraw) all the time. That is, this doesn't take into account time spent on other activities, like OnUpdate, and it doesn't take into account that frames are possibly not rendered continously (when AutoRedisplay = False , we may render frames seldom, because there's no need to do it more often).
See also
- RealTime
- How many frames per second were rendered.
|
 |
property RealTime: Double read FRealTime; |
How many frames per second were rendered. This is a real number of EventDraw (OnDraw) calls per second. This means that it's actual speed of your program. Anything can slow this down, not only long EventDraw (OnDraw), but also slow processing of other events (like OnUpdate). Also, when AutoRedisplay = False , this may be very low, since you just don't need to render frames continously.
See also
- FrameTime
- Rendering speed in frames per second.
|
 |
property UpdateSecondsPassed: Single read FUpdateSecondsPassed; |
Track how much time passed since last Update call, using _UpdateBegin.
The time is in seconds, 1.0 = 1 second. For two times faster computer UpdateSecondsPassed = 0.5, for two times slower UpdateSecondsPassed = 2.0. This is useful for doing time-based rendering, when you want to scale some changes by computer speed, to get perceived animation speed the same on every computer, regardless of computer's speed.
This is calculated as a time between start of previous Update event and start of current Update event. So this really measures your whole loop time (unlike previous DrawSpeed that measured only EventDraw (OnDraw) speed).
You can sanely use this only within EventUpdate (OnUpdate).
|
 |
property UpdateStartTime: TTimerResult read FUpdateStartTime; |
Time of last Update call.
|
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:14
|