MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / renderGlobalUI

Method renderGlobalUI

Source/Falcor/Core/SampleApp.cpp:369–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void SampleApp::renderGlobalUI(Gui* pGui)
370{
371 ImGui::TextUnformatted("Keyboard Shortcuts");
372 ImGui::SameLine();
373 ImGui::TextDisabled("(?)");
374 if (ImGui::IsItemHovered())
375 {
376 ImGui::BeginTooltip();
377 ImGui::PushTextWrapPos(450.0f);
378 ImGui::TextUnformatted(getKeyboardShortcutsStr().c_str());
379 ImGui::PopTextWrapPos();
380 ImGui::EndTooltip();
381 }
382
383 auto controlsGroup = Gui::Group(pGui, "Global Controls");
384 if (controlsGroup.open())
385 {
386 float t = (float)mClock.getTime();
387 if (controlsGroup.var("Time", t, 0.f, FLT_MAX))
388 mClock.setTime(double(t));
389 if (controlsGroup.button("Reset"))
390 mClock.setTime(0.0);
391 bool timePaused = mClock.isPaused();
392 if (controlsGroup.button(timePaused ? "Play" : "Pause", true))
393 timePaused ? mClock.play() : mClock.pause();
394 if (controlsGroup.button("Stop", true))
395 mClock.stop();
396
397 float scale = (float)mClock.getTimeScale();
398 if (controlsGroup.var("Scale", scale, 0.f, FLT_MAX))
399 mClock.setTimeScale(scale);
400 controlsGroup.separator();
401
402 if (controlsGroup.button(mRendererPaused ? "Resume Rendering" : "Pause Rendering"))
403 mRendererPaused = !mRendererPaused;
404 controlsGroup.tooltip(
405 "Freeze the renderer and keep displaying the last rendered frame. The renderer will keep accepting mouse/keyboard/GUI "
406 "messages. Changes in the UI will not be reflected in the displayed image until the renderer is unfrozen"
407 );
408
409 controlsGroup.separator();
410 uint2 screenDims = mpWindow->getClientAreaSize();
411 if (screenSizeUI(controlsGroup, screenDims))
412 resizeFrameBuffer(screenDims.x, screenDims.y);
413
414 controlsGroup.separator();
415
416 mCaptureScreen = controlsGroup.button("Screen Capture");
417 if (controlsGroup.button("Save Config"))
418 saveConfigToFile();
419
420 controlsGroup.release();
421 }
422}
423
424void SampleApp::renderUI()
425{

Callers

nothing calls this directly

Calls 10

screenSizeUIFunction · 0.85
varMethod · 0.80
buttonMethod · 0.80
separatorMethod · 0.80
tooltipMethod · 0.80
GroupFunction · 0.50
openMethod · 0.45
pauseMethod · 0.45
stopMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected