本文整理汇总了C++中TextRenderer::pushBackDebug方法的典型用法代码示例。如果您正苦于以下问题:C++ TextRenderer::pushBackDebug方法的具体用法?C++ TextRenderer::pushBackDebug怎么用?C++ TextRenderer::pushBackDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextRenderer
的用法示例。
在下文中一共展示了TextRenderer::pushBackDebug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getText
//auto getText = [&]()
void getText(TextRenderer &textObj, PerfMon &perfMon, WindowStates &ws)
{
auto fbWidth = ws.fbWidth;
auto fbHeight = ws.fbHeight;
auto winWidth = ws.winWidth;
auto winHeight = ws.winHeight;
stringstream textOut;
textOut << "Frame: " << std::fixed << std::setprecision(1)
<< 1000.0/perfMon.fps.average()
<< "ms max: " << 1000.0/perfMon.fps.min()
<< "ms min: " << 1000.0/perfMon.fps.max() << "ms";
textObj.pushBackDebug(textOut);
textOut << "cpu time: " << std::fixed << std::setprecision(2)
<< perfMon.renderTimes.average() << "ms max: " << perfMon.renderTimes.max()
<< "ms min: " << perfMon.renderTimes.min();
textObj.pushBackDebug(textOut);
textOut << "gpu time: " << std::fixed << std::setprecision(2)
<< perfMon.gpuRenderTimes.average() << "ms max: " << perfMon.gpuRenderTimes.max()
<< "ms min: " << perfMon.gpuRenderTimes.min();
// << std::accumulate(gpuTimes.begin(), gpuTimes.end(), 0) << "ms";
textObj.pushBackDebug(textOut);
textOut << "win " << winWidth << " x " << winHeight
<< " fb size " << fbWidth << " x " << fbHeight;
textObj.pushBackDebug(textOut);
//the following code should go into UserInput and GameLogic, not out here
textOut << "shadow pass: 1 " << ((renderStage & stage1) ? "On" : " ");
textObj.pushBackDebug(textOut);
textOut << "forward pass: 2 " << ((renderStage & stage2) ? "On" : " ");
textObj.pushBackDebug(textOut);
textOut << "highpass: 3 " << ((renderStage & stage3) ? "On" : " ");
textObj.pushBackDebug(textOut);
textOut << "blur1 pass: 4 " << ((renderStage & stage4) ? "On" : " ");
textObj.pushBackDebug(textOut);
textOut << "blur2 pass: 5 " << ((renderStage & stage5) ? "On" : " ");
textObj.pushBackDebug(textOut);
textOut << "composite pass: 6 " << ((renderStage & stage6) ? "On" : " ");
textObj.pushBackDebug(textOut);
textOut << "fxaa pass: 7 " << ((renderStage & stage7) ? "On" : " ");
textObj.pushBackDebug(textOut);
}