"L. Spiro Engine"
|
High-resolution time class. More...
#include <LSSTDTime.h>
Public Member Functions | |
LSE_INLINE LSUINT64 LSE_CALL | GetCurMicros () const |
LSE_INLINE LSUINT64 LSE_CALL | GetCurVirtMicros () const |
LSE_INLINE LSUINT64 LSE_CALL | GetCurMills () const |
LSE_INLINE LSUINT64 LSE_CALL | GetCurVirtMills () const |
LSE_INLINE LSUINT32 LSE_CALL | GetCurFrame () const |
LSE_INLINE LSUINT32 LSE_CALL | GetCurVirtFrame () const |
LSE_INLINE LSUINT64 LSE_CALL | GetMicrosSinceLastFrame () const |
LSE_INLINE LSUINT64 LSE_CALL | GetVirtMicrosSinceLastFrame () const |
LSE_INLINE LSUINT64 LSE_CALL | GetMillsSinceLastFrame () const |
LSE_INLINE LSUINT64 LSE_CALL | GetVirtMillsSinceLastFrame () const |
LSE_INLINE LSFLOAT LSE_CALL | GetSecondsSinceLastFrame () const |
LSE_INLINE LSFLOAT LSE_CALL | GetVirtSecondsSinceLastFrame () const |
LSE_INLINE LSUINT64 LSE_CALL | GetTicksSinceLastFrame () const |
LSE_INLINE LSUINT64 LSE_CALL | GetCurTicks () const |
LSVOID LSE_CALL | Reset () |
LSVOID LSE_CALL | Update (LSBOOL _bUpdateVirtuals) |
LSVOID LSE_CALL | UpdateBy (LSUINT64 _ui64Amnt, LSBOOL _bUpdateVirtuals) |
LSVOID LSE_CALL | UpdateByConstantTime (LSUINT64 _ui64Amnt, LSBOOL _bUpdateVirtuals) |
LSUINT32 LSE_CALL | GetConstantStepUpdateTimesFromTicks (LSUINT64 _ui64Ticks, LSUINT32 &_ui32UnitsToNextUpdate) |
LSUINT64 LSE_CALL | MicrosToTicks (LSUINT64 _ui64Amnt) const |
LSUINT64 LSE_CALL | GetRealTime () const |
Protected Attributes | |
LSUINT64 | m_ui64Resolution |
LSUINT64 | m_ui64CurTime |
LSUINT64 | m_ui64LastTime |
LSUINT64 | m_ui64CurVirtTime |
LSUINT64 | m_ui64LastVirtTime |
LSUINT64 | m_ui64LastRealTime |
LSUINT64 | m_ui64CurMicros |
LSUINT64 | m_ui64LastMicros |
LSUINT64 | m_ui64CurVirtMicros |
LSUINT64 | m_ui64LastVirtMicros |
LSUINT32 | m_ui32Frame |
LSUINT32 | m_ui32VirtFrame |
LSBOOL | m_bHiRes |
High-resolution time class.
Class CTime Description: Cross-platform time-management. Tracks time in microseconds (1,000,000 per second). Also provides frame count and virtual time/frame values for pausing. When paused, virtual values re not updated, causing any objects/systems using the virtual time values to stop (effectively pausing them). Use the regular time values for systems that cannot be paused, such as the menus, which should flash and animate regardless of the pause status.
LSUINT32 LSE_CALL lsstd::CTime::GetConstantStepUpdateTimesFromTicks | ( | LSUINT64 | _ui64Ticks, |
LSUINT32 & | _ui32UnitsToNextUpdate | ||
) |
Get the number of cycles and amount of tick updates needed to advance the time by the constant time step given.
_ui64Ticks | Number of ticks by which to update the time. Must be a constant number, used for every call to this function for a given instance. The time is not updated by this amount, but instead returns the number of updates needed to make the timer approximately current by this value. |
_ui32UnitsToNextUpdate | Holds a returned value indicating the number of 1,000th units that would need to pass for another update to happen at the given tick rate. |
LSE_INLINE LSUINT32 LSE_CALL lsstd::CTime::GetCurFrame | ( | ) | const |
Get the current frame.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetCurMicros | ( | ) | const |
Get the current microseconds.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetCurMills | ( | ) | const |
Get the current milliseconds.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetCurTicks | ( | ) | const |
Get the current number of ticks. Ticks are machine-dependent and should not be used for tracking time.
LSE_INLINE LSUINT32 LSE_CALL lsstd::CTime::GetCurVirtFrame | ( | ) | const |
Get the current virtual frame.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetCurVirtMicros | ( | ) | const |
Get the current virtual microseconds.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetCurVirtMills | ( | ) | const |
Get the current virtual milliseconds.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetMicrosSinceLastFrame | ( | ) | const |
Get the microseconds since last frame.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetMillsSinceLastFrame | ( | ) | const |
Get the milliseconds since last frame.
LSUINT64 LSE_CALL lsstd::CTime::GetRealTime | ( | ) | const |
Get the real system time. Not to be used for any other purpose besides random-number seeding.
LSE_INLINE LSFLOAT LSE_CALL lsstd::CTime::GetSecondsSinceLastFrame | ( | ) | const |
Get the seconds since last frame as a floating-point value.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetTicksSinceLastFrame | ( | ) | const |
Get the actual amount of time passed since last frame. This value should never be used. The amount of time it measures changes per device/hardware. It is not useful for telling time.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetVirtMicrosSinceLastFrame | ( | ) | const |
Get the virtual microseconds since last frame.
LSE_INLINE LSUINT64 LSE_CALL lsstd::CTime::GetVirtMillsSinceLastFrame | ( | ) | const |
Get the virtual milliseconds since last frame.
LSE_INLINE LSFLOAT LSE_CALL lsstd::CTime::GetVirtSecondsSinceLastFrame | ( | ) | const |
Get the virtual seconds since last frame as a floating-point value..
LSUINT64 LSE_CALL lsstd::CTime::MicrosToTicks | ( | LSUINT64 | _ui64Amnt | ) | const |
Convert microseconds to tick values used by this timer internally.
_ui64Amnt | The value to convert. |
LSVOID LSE_CALL lsstd::CTime::Reset | ( | ) |
Reset the time. Causes it to begin ticking all values from 0.
LSVOID LSE_CALL lsstd::CTime::Update | ( | LSBOOL | _bUpdateVirtuals | ) |
Update the time.
_bUpdateVirtuals | If true, virtual values are updated as well. |
LSVOID LSE_CALL lsstd::CTime::UpdateBy | ( | LSUINT64 | _ui64Amnt, |
LSBOOL | _bUpdateVirtuals | ||
) |
Update the time by a certain amount.
_ui64Amnt | Number of ticks by which to update the time. |
_bUpdateVirtuals | If true, virtual values are updated as well. |
LSVOID LSE_CALL lsstd::CTime::UpdateByConstantTime | ( | LSUINT64 | _ui64Amnt, |
LSBOOL | _bUpdateVirtuals | ||
) |
Update by a constant time factor given in ticks. Used in conjunction with GetConstantStepUpdateTimesFromTicks().
_ui64Amnt | Number of ticks by which to update the time. |
_bUpdateVirtuals | If true, virtual values are updated as well. |
LSBOOL lsstd::CTime::m_bHiRes [protected] |
Are we high-resolution enabled?
LSUINT32 lsstd::CTime::m_ui32Frame [protected] |
Frame count.
LSUINT64 lsstd::CTime::m_ui64CurMicros [protected] |
Current microseconds.
LSUINT64 lsstd::CTime::m_ui64CurTime [protected] |
Current time (starts at 0).
LSUINT64 lsstd::CTime::m_ui64CurVirtMicros [protected] |
Current virtual microseconds.
LSUINT64 lsstd::CTime::m_ui64CurVirtTime [protected] |
Virtual ticks.
LSUINT64 lsstd::CTime::m_ui64LastMicros [protected] |
Last microseconds.
LSUINT64 lsstd::CTime::m_ui64LastRealTime [protected] |
Record of the last real time (to handle integer overflow).
LSUINT64 lsstd::CTime::m_ui64LastTime [protected] |
Time last update.
LSUINT64 lsstd::CTime::m_ui64LastVirtMicros [protected] |
Last virtual microseconds.
LSUINT64 lsstd::CTime::m_ui64Resolution [protected] |
Timer resolution.