31 #ifndef OGRE_HELPERS_COMPATIBILITY_H
32 #define OGRE_HELPERS_COMPATIBILITY_H
35 #include <OgreSimpleRenderable.h>
36 #include <OgreSceneNode.h>
38 #if OGRE_VERSION < OGRE_VERSION_CHECK(1, 10, 8)
39 #include <OgreSceneManager.h>
41 #include <OgreMaterialManager.h>
58 #if OGRE_VERSION < OGRE_VERSION_CHECK(1, 10, 8)
59 inline void setMaterial(Ogre::SimpleRenderable& renderable,
const std::string& material_name)
61 renderable.setMaterial(material_name);
64 inline void setMaterial(Ogre::SimpleRenderable& renderable,
const Ogre::MaterialPtr& material)
66 renderable.setMaterial(material->getName());
69 inline void setMaterial(Ogre::SimpleRenderable& renderable,
const std::string& material_name)
71 Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName(material_name);
76 OGRE_EXCEPT(Ogre::Exception::ERR_ITEM_NOT_FOUND,
"Could not find material " + material_name,
77 "SimpleRenderable::setMaterial");
79 renderable.setMaterial(material);
82 inline void setMaterial(Ogre::SimpleRenderable& renderable,
const Ogre::MaterialPtr& material)
84 renderable.setMaterial(material);
88 #if OGRE_VERSION < OGRE_VERSION_CHECK(1, 10, 8)
91 child->removeAndDestroyAllChildren();
92 parent->removeChild(child);
93 child->getCreator()->destroySceneNode(child);
98 parent->removeAndDestroyChild(child);