TimeManager
Engine/source/platform/platformTimer.h
Utility class to fire journalled time-delta events at regular intervals.
Private Attributes
Public Attributes
Private Functions
Public Functions
const bool
setBackground(const bool isBackground)
setBackgroundThreshold(const S32 msInterval)
setForegroundThreshold(const S32 msInterval)
Detailed Description
Utility class to fire journalled time-delta events at regular intervals.
Most games and simulations need the ability to update their state based on a time-delta. However, tracking time accurately and sending out well-conditioned events (for instance, allowing no events with delta=0) tends to be platform specific. This class provides an abstraction around this platform mojo.
In addition, a well behaved application may want to alter how frequently it processes time advancement depending on its execution state. For instance, a game running in the background can significantly reduce CPU usage by only updating every 100ms, instead of trying to maintain a 1ms update update rate.
Private Attributes
bool mBackground
S32 mBackgroundThreshold
S32 mForegroundThreshold
PlatformTimer * mTimer
Public Attributes
TimeManagerEvent timeEvent
Private Functions
_updateTime()
Public Functions
TimeManager()
~TimeManager()
getBackground()
getBackgroundThreshold()
getForegroundThreshold()
setBackground(const bool isBackground)
setBackgroundThreshold(const S32 msInterval)
setForegroundThreshold(const S32 msInterval)