|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Configuration options for an Application. More...
#include <GREM/application/Application.hpp>
Public Attributes | |
| Duration | tickInterval = duration_cast<Duration>(FloatSeconds{1.0f}) / 60 |
| Desired average time between ticks, i.e. the reciprocal of the application's desired tick rate. | |
| Duration | maxAccumulatedTickTime = Seconds{1} |
| Maximum time to process accumulated ticks for before starting to skip ticks. | |
| Duration | minFrameTime |
| Minimum frame time before frames are delayed, i.e. the reciprocal of the application's maximum frame rate. | |
| Duration | maxFrameTime = duration_cast<Duration>(FloatSeconds{1.0f}) / 5 |
| Maximum frame time before tick time is accumulated and deferred to later frames, i.e. the reciprocal of the application's minimum acceptable frame rate. | |
| bool | frameRateLimiterSleepEnabled |
| Put the thread that is running the application to sleep until the next frame is supposed to begin if the maximum frame rate is exceeded. | |
Configuration options for an Application.
| Duration grem::application::ApplicationOptions::tickInterval = duration_cast<Duration>(FloatSeconds{1.0f}) / 60 |
Desired average time between ticks, i.e. the reciprocal of the application's desired tick rate.
This controls the rate at which the application will try to execute calls to tick(), which is the main mechanism for providing application subsystems with updates at a fixed interval, independent from the main frame rate of the application.
Tick processing is performed on each frame of the application, which may result in anywhere from 0 to maxFrameTime / tickInterval ticks being processed, depending on the time elapsed since the previous frame. When not enough time has passed to process any ticks within a frame, the time is accumulated for the next frame, and so on, until enough time has passed to process another tick. If several ticks' worth of time passed since the previous frame, multiple ticks will be processed (up to maxAccumulatedTickTime, after which ticks will be skipped), and any remaining (unskipped) time will carry over to the next frame. This results in a fixed average interval between ticks, even in the event of high framerates or small frame rate drops (unless maxAccumulatedTickTime is hit).
If set to zero or lower, no tick processing will occur, and tick() will never be called.
Maximum time to process accumulated ticks for before starting to skip ticks.
If set to zero or lower, an unlimited amount of tick time may accumulate, and the maximum number of ticks allowed by maxFrameTime will keep being processed every frame until the CPU catches up. This will ensure eventual consistency with the real wall clock time, but may cause a prolonged "fast forward" effect when tabbing back into a program that has been suspended for a long time.
| Duration grem::application::ApplicationOptions::minFrameTime |
Minimum frame time before frames are delayed, i.e. the reciprocal of the application's maximum frame rate.
If the frame rate is too fast, and the frame time goes below this limit, the application will wait until enough time has passed for the next frame to begin before continuing.
If set to zero or lower, the application will have no frame rate limit.
| Duration grem::application::ApplicationOptions::maxFrameTime = duration_cast<Duration>(FloatSeconds{1.0f}) / 5 |
Maximum frame time before tick time is accumulated and deferred to later frames, i.e. the reciprocal of the application's minimum acceptable frame rate.
If the frame rate is too slow, and the frame time goes above this limit, the application will start to delay the processing of some ticks in order to avoid a spiral of death where the amount of ticks to process continues to increase faster than they can be processed, which would lead to the application becoming completely unresponsive.
If set to zero or lower, or to a value lower than the tick interval, the maximum number of ticks per frame will be set to 1, causing ticks to always be delayed whenever the frame rate goes below the tick rate. This is generally not recommended.
| bool grem::application::ApplicationOptions::frameRateLimiterSleepEnabled |
Put the thread that is running the application to sleep until the next frame is supposed to begin if the maximum frame rate is exceeded.
This helps reduce the CPU usage of the application in low-load scenarios.