本文整理汇总了C++中Profiler::EndBlock方法的典型用法代码示例。如果您正苦于以下问题:C++ Profiler::EndBlock方法的具体用法?C++ Profiler::EndBlock怎么用?C++ Profiler::EndBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::EndBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FinishBackgroundLoading
void BackgroundLoader::FinishBackgroundLoading(BackgroundLoadItem& item)
{
Resource* resource = item.resource_;
bool success = resource->GetAsyncLoadState() == ASYNC_SUCCESS;
// If BeginLoad() phase was successful, call EndLoad() and get the final success/failure result
if (success)
{
#ifdef URHO3D_PROFILING
String profileBlockName("Finish" + resource->GetTypeName());
Profiler* profiler = owner_->GetSubsystem<Profiler>();
if (profiler)
profiler->BeginBlock(profileBlockName.CString());
#endif
LOGDEBUG("Finishing background loaded resource " + resource->GetName());
success = resource->EndLoad();
#ifdef URHO3D_PROFILING
if (profiler)
profiler->EndBlock();
#endif
}
resource->SetAsyncLoadState(ASYNC_DONE);
if (!success && item.sendEventOnFailure_)
{
using namespace LoadFailed;
VariantMap& eventData = owner_->GetEventDataMap();
eventData[P_RESOURCENAME] = resource->GetName();
owner_->SendEvent(E_LOADFAILED, eventData);
}
// Send event, either success or failure
{
using namespace ResourceBackgroundLoaded;
VariantMap& eventData = owner_->GetEventDataMap();
eventData[P_RESOURCENAME] = resource->GetName();
eventData[P_SUCCESS] = success;
eventData[P_RESOURCE] = resource;
owner_->SendEvent(E_RESOURCEBACKGROUNDLOADED, eventData);
}
// Store to the cache; use same mechanism as for manual resources
if (success || owner_->GetReturnFailedResources())
owner_->AddManualResource(resource);
}
示例2: PostStep
void PhysicsWorld::PostStep(float timeStep)
{
#ifdef ATOMIC_PROFILING
Profiler* profiler = GetSubsystem<Profiler>();
if (profiler)
profiler->EndBlock();
#endif
SendCollisionEvents();
// Send post-step event
using namespace PhysicsPostStep;
VariantMap& eventData = GetEventDataMap();
eventData[P_WORLD] = this;
eventData[P_TIMESTEP] = timeStep;
SendEvent(E_PHYSICSPOSTSTEP, eventData);
}