| 422 | } |
| 423 | |
| 424 | void SampleApp::renderUI() |
| 425 | { |
| 426 | RenderContext* pRenderContext = mpDevice->getRenderContext(); |
| 427 | Profiler* pProfiler = mpDevice->getProfiler(); |
| 428 | |
| 429 | FALCOR_PROFILE(pRenderContext, "renderUI"); |
| 430 | |
| 431 | if (mShowUI || pProfiler->isEnabled()) |
| 432 | { |
| 433 | mpGui->beginFrame(); |
| 434 | |
| 435 | if (mShowUI) |
| 436 | onGuiRender(mpGui.get()); |
| 437 | |
| 438 | if (pProfiler->isEnabled()) |
| 439 | { |
| 440 | uint32_t y = mpTargetFBO->getHeight() - 360; |
| 441 | |
| 442 | bool open = pProfiler->isEnabled(); |
| 443 | Gui::Window profilerWindow(mpGui.get(), "Profiler", open, {800, 600}, {350, 80}); |
| 444 | pProfiler->endEvent(pRenderContext, "renderUI"); // Stop the timer |
| 445 | |
| 446 | if (open) |
| 447 | { |
| 448 | if (!mpProfilerUI) |
| 449 | mpProfilerUI = std::make_unique<ProfilerUI>(pProfiler); |
| 450 | mpProfilerUI->render(); |
| 451 | pProfiler->startEvent(pRenderContext, "renderUI"); |
| 452 | profilerWindow.release(); |
| 453 | } |
| 454 | |
| 455 | pProfiler->setEnabled(open); |
| 456 | } |
| 457 | |
| 458 | mpGui->render(pRenderContext, mpTargetFBO, (float)mFrameRate.getLastFrameTime()); |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | void SampleApp::renderFrame() |
| 463 | { |
nothing calls this directly
no test coverage detected