MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName("MyMaterial"); Material::TechniqueIterator techniqueIter = material->getTechniqueIterator(); while (techniqueIter.hasMoreElements()) { Technique* technique = techniqueIter.getNext(); // Use technique properties here }
void printTechniqueName(MaterialPtr material) { Material::TechniqueIterator techniqueIter = material->getTechniqueIterator(); while (techniqueIter.hasMoreElements()) { Technique* technique = techniqueIter.getNext(); std::cout << "Technique name: " << technique->getName() << std::endl; } } // Call the function with a material MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName("MyMaterial"); printTechniqueName(material);In the first example, we use getTechniqueIterator to loop through the techniques in a material and access their properties. In the second example, we define a function that takes a material as an argument, uses getTechniqueIterator to loop through the techniques, and prints their names to the console. The package library for cpp ogre MaterialPtr getTechniqueIterator is the OGRE Graphics Library.