本文整理汇总了C++中ogre::Overlay::setZOrder方法的典型用法代码示例。如果您正苦于以下问题:C++ Overlay::setZOrder方法的具体用法?C++ Overlay::setZOrder怎么用?C++ Overlay::setZOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Overlay
的用法示例。
在下文中一共展示了Overlay::setZOrder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createInput
void BasisManager::createInput() // создаем систему ввода
{
Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
OIS::ParamList pl;
size_t windowHnd = 0;
std::ostringstream windowHndStr;
mWindow->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
mInputManager = OIS::InputManager::createInputSystem( pl );
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
mKeyboard->setEventCallback(this);
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));
mMouse->setEventCallback(this);
mRoot->addFrameListener(this);
windowResized(mWindow); // инициализация
Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this);
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName("wallpaper");
if (false == material.isNull()) {
Ogre::OverlayManager & manager = Ogre::OverlayManager::getSingleton();
Ogre::Overlay * overlay = manager.create("wallpaper");
overlay->setZOrder(0);
overlay->show();
Ogre::PanelOverlayElement * panel = static_cast<Ogre::PanelOverlayElement*>(manager.createOverlayElement("Panel", "wallpaper"));
panel->setDimensions(1, 1);
/*Ogre::FontPtr mpFont = Ogre::FontManager::getSingleton().getByName("MyGUI_font");
mpFont->load();
if (!mpFont.isNull()) {
const Ogre::MaterialPtr & material2 = mpFont->getMaterial();
panel->setMaterialName(material2->getName());
}*/
panel->setMaterialName(material->getName());
overlay->add2D(panel);
}
}
示例2: createKinectOverlay
void OgreAppLogic::createKinectOverlay(const std::string& colorTextureName, const std::string& depthTextureName, const std::string& coloredDepthTextureName)
{
//Create Color Overlay
{
//Create Overlay
Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
Ogre::Overlay* overlay = overlayManager.create("KinectColorOverlay");
//Create Material
const std::string materialName = "KinectColorMaterial";
Ogre::MaterialPtr material = MaterialManager::getSingleton().create(materialName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
material->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
material->getTechnique(0)->getPass(0)->createTextureUnitState(colorTextureName);
//Create Panel
Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*>(overlayManager.createOverlayElement("Panel", "KinectColorPanel"));
panel->setMetricsMode(Ogre::GMM_PIXELS);
panel->setMaterialName(materialName);
panel->setDimensions((float)Kinect::colorWidth/4, (float)Kinect::colorHeight/4);
panel->setPosition(0.0f, 0.0f);
overlay->add2D(panel);
overlay->setZOrder(300);
overlay->show();
}
//Create Depth Overlay
{
//Create Overlay
Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
Ogre::Overlay* overlay = overlayManager.create("KinectDepthOverlay");
//Create Material
const std::string materialName = "KinectDepthMaterial";
Ogre::MaterialPtr material = MaterialManager::getSingleton().create(materialName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
material->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
material->getTechnique(0)->getPass(0)->setAlphaRejectSettings(CMPF_GREATER, 127);
material->getTechnique(0)->getPass(0)->createTextureUnitState(depthTextureName);
//material->getTechnique(0)->getPass(0)->setVertexProgram("Ogre/Compositor/StdQuad_vp");
//material->getTechnique(0)->getPass(0)->setFragmentProgram("KinectDepth");
//Create Panel
Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*>(overlayManager.createOverlayElement("Panel", "KinectDepthPanel"));
panel->setMetricsMode(Ogre::GMM_PIXELS);
panel->setMaterialName(materialName);
panel->setDimensions((float)Kinect::depthWidth/4, (float)Kinect::depthHeight/4);
panel->setPosition((float)640.0f/4, 0.0f);
overlay->add2D(panel);
overlay->setZOrder(310);
overlay->show();
}
//Create Colored Depth Overlay
{
//Create Overlay
Ogre::OverlayManager& overlayManager = Ogre::OverlayManager::getSingleton();
Ogre::Overlay* overlay = overlayManager.create("KinectColoredDepthOverlay");
//Create Material
const std::string materialName = "KinectColoredDepthMaterial";
Ogre::MaterialPtr material = MaterialManager::getSingleton().create(materialName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
material->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
material->getTechnique(0)->getPass(0)->createTextureUnitState(coloredDepthTextureName);
//Create Panel
Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*>(overlayManager.createOverlayElement("Panel", "KinectColoredDepthPanel"));
panel->setMetricsMode(Ogre::GMM_PIXELS);
panel->setMaterialName(materialName);
panel->setDimensions((float)Kinect::depthWidth/4, (float)Kinect::depthHeight/4);
panel->setPosition((float)1280.0f/4, 0.0f);
overlay->add2D(panel);
overlay->setZOrder(320);
overlay->show();
}
}