Function renderUI


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

void renderUI(Gui::Window &w)


Render the UI


Lines 217-251 in Source/Falcor/Utils/Timing/Clock.cpp. Line 187 in Source/Falcor/Utils/Timing/Clock.h.

void Clock::renderUI(Gui::Window& w)
    const auto& tex = gClockTextures;
    float time = (float)getTime();
    float scale = (float)getTimeScale();
    if (w.var("Time##Cur", time, 0.f, FLT_MAX, 0.001f, false, "%.3f")) setTime(time);
    if (!isSimulatingFps() && w.var("Scale", scale)) setTimeScale(scale);
    bool showStep = mPaused && isSimulatingFps();
    float indent = showStep ? 10.0f : 60.0f;
    static const uint2 iconSize = { 25, 25 };
    if (w.imageButton("Rewind", tex.pRewind, iconSize)) setTime(0);
    if (showStep && w.imageButton("PrevFrame", tex.pPrevFrame, iconSize, true, true)) step(-1);
    if (w.imageButton("Stop", tex.pStop, iconSize, true, true)) stop();
    auto pTex = mPaused ? tex.pPlay : tex.pPause;
    if (w.imageButton("PlayPause", pTex, iconSize, true, true)) mPaused ? play() : pause();
    if (showStep && w.imageButton("NextFrame", tex.pNextFrame, iconSize, true, true)) step();
    w.text("Framerate Simulation");
    w.tooltip("Simulate a constant frame rate. The time will advance by 1/FPS each frame, regardless of the actual frame rendering time");
    auto fps = fpsDropdown(w, mFramerate);
    if (fps) setFramerate(fps.value());
    if (isSimulatingFps())
        uint64_t curFrame = getFrame();
        if (w.var("Frame ID", curFrame)) setFrame(curFrame);

Add Discussion as Guest

Log in to DocsForge