本文整理汇总了C++中ogre::SceneManager::addRenderQueueListener方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneManager::addRenderQueueListener方法的具体用法?C++ SceneManager::addRenderQueueListener怎么用?C++ SceneManager::addRenderQueueListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneManager
的用法示例。
在下文中一共展示了SceneManager::addRenderQueueListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSceneManager
void setSceneManager(Ogre::SceneManager* _scene)
{
if (nullptr != mSceneManager)
{
mSceneManager->removeRenderQueueListener(this);
mSceneManager = nullptr;
}
mSceneManager = _scene;
if (nullptr != mSceneManager)
{
mSceneManager->addRenderQueueListener(this);
}
}
示例2: createDummyScene
void ApplicationContext::createDummyScene()
{
mWindow->removeAllViewports();
Ogre::SceneManager* sm = mRoot->createSceneManager(Ogre::ST_GENERIC, "DummyScene");
sm->addRenderQueueListener(mOverlaySystem);
Ogre::Camera* cam = sm->createCamera("DummyCamera");
mWindow->addViewport(cam);
#ifdef OGRE_BUILD_COMPONENT_RTSHADERSYSTEM
// Initialize shader generator.
// Must be before resource loading in order to allow parsing extended material attributes.
if (!initialiseRTShaderSystem())
{
OGRE_EXCEPT(Ogre::Exception::ERR_FILE_NOT_FOUND,
"Shader Generator Initialization failed - Core shader libs path not found",
"ApplicationContext::createDummyScene");
}
mShaderGenerator->addSceneManager(sm);
#endif // OGRE_BUILD_COMPONENT_RTSHADERSYSTEM
}
示例3: CreateOcean
void EC_MeshmoonWater::CreateOcean()
{
#ifdef MESHMOON_TRITON
if (!visible.Get() || state_.ocean)
return;
Ogre::SceneManager *ogreSceneManager = OgreSceneManager();
if (!ogreSceneManager)
{
LogError(LC + "Failed to initialize Triton library, renderer not available!");
return;
}
OgreRendererPtr renderer = Renderer();
if (!renderer)
return;
// On Windows assuming we're using D3D9, but fall back to OpenGL if that's not the case.
void* d3dDevice = 0;
#ifdef DIRECTX_ENABLED
Ogre::D3D9RenderWindow* renderWindow = dynamic_cast<Ogre::D3D9RenderWindow*>(renderer->GetCurrentRenderWindow());
if (renderWindow)
d3dDevice = renderWindow->getD3D9Device();
#endif
state_.environment = new Triton::Environment();
state_.environment->SetLicenseCode(TRITON_USERNAME, TRITON_LICENCE_KEY);
QString resourcePath = QDir::toNativeSeparators(QDir(Application::InstallationDirectory()).absoluteFilePath("media/meshmoon/triton"));
state_.resourceLoader = new Triton::ResourceLoader(resourcePath.toStdString().c_str());
Triton::EnvironmentError error = state_.environment->Initialize(Triton::FLAT_YUP,
d3dDevice == 0 ? Triton::OPENGL_2_0 : Triton::DIRECTX_9,
state_.resourceLoader, d3dDevice);
if (error != Triton::SUCCEEDED)
{
LogError(LC + "Error while initializing Triton.");
return;
}
// Create ocean.
if (!state_.Setup(Triton::Ocean::Create(state_.environment, static_cast<Triton::WaterModelTypes>(simulationModel.Get()+1), enableHeightQueries.Get()),
static_cast<SimulationModel>(simulationModel.Get()), reflectionsEnabled.Get(), enableHeightQueries.Get()))
{
LogError(LC + "Failed to create Triton ocean!");
DestroyOcean();
return;
}
// Set attributes
state_.ocean->EnableSpray(sprayEnabled.Get());
state_.ocean->EnableWireframe(drawDebug.Get());
state_.ocean->SetChoppiness(waveChoppiness.Get());
state_.ocean->SetRefractionColor(ToTritonVector3(waterColor.Get()));
state_.environment->SetSeaLevel(seaLevel.Get());
UpdateWeatherConditions();
// Add listeners to render ocean in right time.
renderQueueListener_ = new MeshmoonWaterRenderQueueListener(this, 0xFFFFFFF0);
renderSystemListener_ = new MeshmoonWaterRenderSystemListener(this);
renderTargetListener_ = new MeshmoonWaterRenderTargetListener(this);
ogreSceneManager->addRenderQueueListener(renderQueueListener_);
ogreSceneManager->getRenderQueue()->getQueueGroup(renderQueueListener_->renderQueueId); // Registers our custom queue id to be executed.
Ogre::Root::getSingleton().getRenderSystem()->addListener(renderSystemListener_);
#endif
}
示例4: choose_scene_mgr
void application::choose_scene_mgr()
{
scene_mgr = root->createSceneManager(Ogre::ST_GENERIC);
overlay = new Ogre::OverlaySystem();
scene_mgr->addRenderQueueListener(overlay);
}