本文整理汇总了C++中Profiler::GetData方法的典型用法代码示例。如果您正苦于以下问题:C++ Profiler::GetData方法的具体用法?C++ Profiler::GetData怎么用?C++ Profiler::GetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::GetData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DumpProfiler
void Engine::DumpProfiler()
{
Profiler* profiler = GetSubsystem<Profiler>();
if (profiler)
LOGRAW(profiler->GetData(true, true) + "\n");
}
示例2: Update
void DebugHud::Update()
{
Graphics* graphics = GetSubsystem<Graphics>();
Renderer* renderer = GetSubsystem<Renderer>();
if (!renderer || !graphics)
return;
// Ensure UI-elements are not detached
if (!statsText_->GetParent())
{
UI* ui = GetSubsystem<UI>();
UIElement* uiRoot = ui->GetRoot();
uiRoot->AddChild(statsText_);
uiRoot->AddChild(modeText_);
uiRoot->AddChild(profilerText_);
}
if (statsText_->IsVisible())
{
unsigned primitives, batches;
if (!useRendererStats_)
{
primitives = graphics->GetNumPrimitives();
batches = graphics->GetNumBatches();
}
else
{
primitives = renderer->GetNumPrimitives();
batches = renderer->GetNumBatches();
}
String stats;
stats.AppendWithFormat("Triangles %u\nBatches %u\nViews %u\nLights %u\nShadowmaps %u\nOccluders %u",
primitives,
batches,
renderer->GetNumViews(),
renderer->GetNumLights(true),
renderer->GetNumShadowMaps(true),
renderer->GetNumOccluders(true));
if (!appStats_.Empty())
{
stats.Append("\n");
for (HashMap<String, String>::ConstIterator i = appStats_.Begin(); i != appStats_.End(); ++i)
stats.AppendWithFormat("\n%s %s", i->first_.CString(), i->second_.CString());
}
statsText_->SetText(stats);
}
if (modeText_->IsVisible())
{
String mode;
mode.AppendWithFormat("Tex:%s Mat:%s Spec:%s Shadows:%s Size:%i Quality:%s Occlusion:%s Instancing:%s API:%s",
qualityTexts[renderer->GetTextureQuality()],
qualityTexts[renderer->GetMaterialQuality()],
renderer->GetSpecularLighting() ? "On" : "Off",
renderer->GetDrawShadows() ? "On" : "Off",
renderer->GetShadowMapSize(),
shadowQualityTexts[renderer->GetShadowQuality()],
renderer->GetMaxOccluderTriangles() > 0 ? "On" : "Off",
renderer->GetDynamicInstancing() ? "On" : "Off",
graphics->GetApiName().CString());
modeText_->SetText(mode);
}
Profiler* profiler = GetSubsystem<Profiler>();
if (profiler)
{
if (profilerTimer_.GetMSec(false) >= profilerInterval_)
{
profilerTimer_.Reset();
if (profilerText_->IsVisible())
{
String profilerOutput = profiler->GetData(false, false, profilerMaxDepth_);
profilerText_->SetText(profilerOutput);
}
profiler->BeginInterval();
}
}
}