Function setFramerate

Synopsis

#include <Source/Falcor/Utils/Timing/Clock.h>

Clock & setFramerate(uint32_t fps)

Description

Set the requested FPS to simulate, or disable FPS simulation. When enabling FPS simulation, calls to tick() will change the time by 1/FPS seconds. If FPS simulation is disabled, calling tick() will add the actual time that passed since the previous tick() call

Source

Lines 100-112 in Source/Falcor/Utils/Timing/Clock.cpp. Line 130 in Source/Falcor/Utils/Timing/Clock.h.

Clock& Clock::setFramerate(uint32_t fps)
{
    mFramerate = fps;
    mTicksPerFrame = 0;
    if(fps)
    {
        if (kTicksPerSecond % fps) logWarning("Clock::setFramerate() - requested FPS can't be accurately represented. Expect rounding errors");
        mTicksPerFrame = kTicksPerSecond / fps;
    }
    if(!mDeferredFrameID && !mDeferredTime) setTime(mTime.now);
    return *this;
}





Add Discussion as Guest

Log in to DocsForge