本文整理汇总了C++中SharedPtr::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedPtr::Append方法的具体用法?C++ SharedPtr::Append怎么用?C++ SharedPtr::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharedPtr
的用法示例。
在下文中一共展示了SharedPtr::Append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupViewports
void MultipleViewports::SetupViewports()
{
Graphics* graphics = GetSubsystem<Graphics>();
Renderer* renderer = GetSubsystem<Renderer>();
renderer->SetNumViewports(2);
// Set up the front camera viewport
SharedPtr<Viewport> viewport(new Viewport(context_, scene_, cameraNode_->GetComponent<Camera>()));
renderer->SetViewport(0, viewport);
// Clone the default render path so that we do not interfere with the other viewport, then add
// bloom and FXAA post process effects to the front viewport. Render path commands can be tagged
// for example with the effect name to allow easy toggling on and off. We start with the effects
// disabled.
ResourceCache* cache = GetSubsystem<ResourceCache>();
SharedPtr<RenderPath> effectRenderPath = viewport->GetRenderPath()->Clone();
effectRenderPath->Append(cache->GetResource<XMLFile>("PostProcess/Bloom.xml"));
effectRenderPath->Append(cache->GetResource<XMLFile>("PostProcess/EdgeFilter.xml"));
// Make the bloom mixing parameter more pronounced
effectRenderPath->SetShaderParameter("BloomMix", Vector2(0.9f, 0.6f));
effectRenderPath->SetEnabled("Bloom", false);
effectRenderPath->SetEnabled("EdgeFilter", false);
viewport->SetRenderPath(effectRenderPath);
// Set up the rear camera viewport on top of the front view ("rear view mirror")
// The viewport index must be greater in that case, otherwise the view would be left behind
SharedPtr<Viewport> rearViewport(new Viewport(context_, scene_, rearCameraNode_->GetComponent<Camera>(),
IntRect(graphics->GetWidth() * 2 / 3, 32, graphics->GetWidth() - 32, graphics->GetHeight() / 3)));
renderer->SetViewport(1, rearViewport);
}