本文整理汇总了C++中SceneRenderer::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneRenderer::Create方法的具体用法?C++ SceneRenderer::Create怎么用?C++ SceneRenderer::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneRenderer
的用法示例。
在下文中一共展示了SceneRenderer::Create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPainter
//[-------------------------------------------------------]
//[ Private virtual PLEngine::EngineApplication functions ]
//[-------------------------------------------------------]
void Application67::OnCreateScene(SceneContainer &cContainer)
{
// Create a scene container with our 'concrete sound scene' using the default sound API
SceneNode *pSceneContainerNode = cContainer.Create("PLSound::SCSound", "SoundScene");
if (pSceneContainerNode && pSceneContainerNode->IsInstanceOf("PLScene::SceneContainer")) {
SceneContainer *pSceneContainer = static_cast<SceneContainer*>(pSceneContainerNode);
// Protect this important container!
pSceneContainer->SetProtected(true);
// Populate the scene container
// Setup scene surface painter
SurfacePainter *pPainter = GetPainter();
if (pPainter && pPainter->IsInstanceOf("PLScene::SPScene")) {
SPScene *pSPScene = static_cast<SPScene*>(pPainter);
pSPScene->SetRootContainer(cContainer.GetContainer());
pSPScene->SetSceneContainer(pSceneContainer);
// Get the scene context
SceneContext *pSceneContext = GetSceneContext();
if (pSceneContext) {
// Create us a scene renderer
SceneRenderer *pSceneRenderer = pSceneContext->GetSceneRendererManager().Create("2DGame");
if (pSceneRenderer) {
// Add begin scene renderer pass
pSceneRenderer->Create("PLCompositing::SRPBegin", "Begin", "TextureFormat=\"R8G8B8A8\" Flags=\"Inactive\"");
// Add our own scene renderer pass
pSceneRenderer->Create("SRP2DGame", "2DGame");
// Add post processing scene renderer pass
pSceneRenderer->Create("PLCompositing::SRPPostProcessing", "PostProcessing");
// Add end scene renderer pass
pSceneRenderer->Create("PLCompositing::SRPEnd", "End");
// Make this scene renderer to the default scene renderer of our scene surface painter
pSPScene->SetDefaultSceneRenderer(pSceneRenderer->GetName());
}
}
}
// Set scene container
SetScene(pSceneContainer);
// Start the game
Restart();
}
}