PixelLightAPI
.
|
#include <Timing.h>
Public Member Functions | |
bool | IsActive () const |
Returns whether the timing is active or not. | |
void | SetActive (bool bActive=true) |
Sets whether the timing is active or not. | |
PLCORE_API void | Reset () |
Resets the timing. | |
PLCORE_API bool | CheckUpdate (uint64 *pnTimeToWait=nullptr) const |
Checks whether the timing has to be updated or not. | |
PLCORE_API bool | Update (uint64 *pnTimeToWait=nullptr) |
Updates all time relevant stuff. | |
float | GetTimeDifference () const |
Returns the past time since last frame (seconds) | |
float | GetTimeDifferenceNoCompensating () const |
Returns the past time since last frame without any compensating (seconds) | |
float | GetMaxTimeDifference () const |
Returns the maximum time difference. | |
void | SetMaxTimeDifference (float fMaxTimeDifference=0.15f) |
Sets the maximum time difference. | |
PLCORE_API uint64 | GetPastTime () const |
Returns the past time in milliseconds since the application start. | |
float | GetTimer () const |
Returns a general timing. | |
float | GetFramesPerSecond () const |
Returns the current frames per second (FPS) | |
uint32 | GetPastFrames () const |
Returns the number of past frames since timing start. | |
float | GetFPSLimit () const |
Returns the FPS limit. | |
void | SetFPSLimit (float fFPSLimit=0.0f) |
Sets the FPS limit. | |
bool | IsFreezed () const |
Returns if the timing is currently freezed or not. | |
PLCORE_API void | Freeze (bool bFreeze=true) |
Set freezed mode. | |
bool | IsPaused () const |
Returns whether the timing is paused of not. | |
void | Pause (bool bPause=true) |
Set pause mode. | |
float | GetTimeScaleFactor () const |
Returns the time scale factor. | |
bool | SetTimeScaleFactor (float fFactor=1.0f) |
Sets the time scale factor. | |
bool | IsSlowMotion () const |
Returns if the slow motion is activated or not. | |
void | SetSlowMotion (bool bSlowMotion=false) |
Activates/deactivates the slow motion mode. | |
float | GetSlowMotionFactor (bool bRealUsed=true) const |
Returns the slow motion factor. | |
bool | SetSlowMotionFactor (float fSlowMotionFactor=1.0f) |
Sets the slow motion factor. | |
float | GetCustomSlowMotionFactor (bool bRealUsed=true) const |
Returns the custom slow motion factor. | |
bool | SetCustomSlowMotionFactor (float fSlowMotionFactor=1.0f) |
Sets the custom slow motion factor. | |
Static Public Member Functions | |
static PLCORE_API Timing * | GetInstance () |
static PLCORE_API bool | HasInstance () |
Timing stuff.
static PLCORE_API Timing* PLCore::Timing::GetInstance | ( | ) | [static] |
static PLCORE_API bool PLCore::Timing::HasInstance | ( | ) | [static] |
bool PLCore::Timing::IsActive | ( | ) | const [inline] |
Returns whether the timing is active or not.
void PLCore::Timing::SetActive | ( | bool | bActive = true | ) | [inline] |
Sets whether the timing is active or not.
[in] | bActive | Should the timing be active? |
PLCORE_API void PLCore::Timing::Reset | ( | ) |
Resets the timing.
PLCORE_API bool PLCore::Timing::CheckUpdate | ( | uint64 * | pnTimeToWait = nullptr | ) | const |
Checks whether the timing has to be updated or not.
[in] | pnTimeToWait | If not a null pointer, if there's a FPS limit and it's not time for an update -> receives the time in milliseconds we need to wait until it's time for the next update, receives '0' in all other cases |
PLCORE_API bool PLCore::Timing::Update | ( | uint64 * | pnTimeToWait = nullptr | ) |
Updates all time relevant stuff.
[in] | pnTimeToWait | If not a null pointer, if there's a FPS limit and it's not time for an update -> receives the time in milliseconds we need to wait until it's time for the next update, receives '0' in all other cases |
float PLCore::Timing::GetTimeDifference | ( | ) | const [inline] |
Returns the past time since last frame (seconds)
Returns the past time since last frame (in seconds)
float PLCore::Timing::GetTimeDifferenceNoCompensating | ( | ) | const [inline] |
Returns the past time since last frame without any compensating (seconds)
Returns the past time since last frame without any clamping (seconds)
float PLCore::Timing::GetMaxTimeDifference | ( | ) | const [inline] |
Returns the maximum time difference.
void PLCore::Timing::SetMaxTimeDifference | ( | float | fMaxTimeDifference = 0.15f | ) | [inline] |
Sets the maximum time difference.
[in] | fMaxTimeDifference | The maximum time difference since the last frame in seconds (> 0) |
PLCORE_API uint64 PLCore::Timing::GetPastTime | ( | ) | const |
Returns the past time in milliseconds since the application start.
float PLCore::Timing::GetTimer | ( | ) | const [inline] |
Returns a general timing.
float PLCore::Timing::GetFramesPerSecond | ( | ) | const [inline] |
Returns the current frames per second (FPS)
uint32 PLCore::Timing::GetPastFrames | ( | ) | const [inline] |
Returns the number of past frames since timing start.
float PLCore::Timing::GetFPSLimit | ( | ) | const [inline] |
Returns the FPS limit.
void PLCore::Timing::SetFPSLimit | ( | float | fFPSLimit = 0.0f | ) | [inline] |
Sets the FPS limit.
[in] | fFPSLimit | FPS limit, 0 if there should be no limitation (>= 0) |
bool PLCore::Timing::IsFreezed | ( | ) | const [inline] |
Returns if the timing is currently freezed or not.
PLCORE_API void PLCore::Timing::Freeze | ( | bool | bFreeze = true | ) |
Set freezed mode.
[in] | bFreeze | Should the timing be freezed or not? |
bool PLCore::Timing::IsPaused | ( | ) | const [inline] |
Returns whether the timing is paused of not.
void PLCore::Timing::Pause | ( | bool | bPause = true | ) | [inline] |
Set pause mode.
[in] | bPause | Should the timing be paused or not? |
float PLCore::Timing::GetTimeScaleFactor | ( | ) | const [inline] |
Returns the time scale factor.
bool PLCore::Timing::SetTimeScaleFactor | ( | float | fFactor = 1.0f | ) | [inline] |
Sets the time scale factor.
[in] | fFactor | Time scale, a factor of <= 0 is NOT allowed! |
bool PLCore::Timing::IsSlowMotion | ( | ) | const [inline] |
Returns if the slow motion is activated or not.
void PLCore::Timing::SetSlowMotion | ( | bool | bSlowMotion = false | ) | [inline] |
Activates/deactivates the slow motion mode.
[in] | bSlowMotion | Should the slow motion mode be activated? |
float PLCore::Timing::GetSlowMotionFactor | ( | bool | bRealUsed = true | ) | const [inline] |
Returns the slow motion factor.
Sets the custom slow motion factor.
[in] | bRealUsed | The real used slow motion factor will be returned. If the slow motion mode is deactivated this will be 1! |
bool PLCore::Timing::SetSlowMotionFactor | ( | float | fSlowMotionFactor = 1.0f | ) | [inline] |
Sets the slow motion factor.
[in] | fSlowMotionFactor | The slow motion factor, a factor of <= 0 is NOT allowed! |
float PLCore::Timing::GetCustomSlowMotionFactor | ( | bool | bRealUsed = true | ) | const [inline] |
Returns the custom slow motion factor.
[in] | bRealUsed | The real used slow motion factor will be returned. If the slow motion mode is deactivated this will be 1! |
bool PLCore::Timing::SetCustomSlowMotionFactor | ( | float | fSlowMotionFactor = 1.0f | ) | [inline] |
Sets the custom slow motion factor.
[in] | fSlowMotionFactor | The slow motion factor, a factor of <= 0 is NOT allowed! |
|