I am playing with creating materials in code. But when I close the application the program throws a an exception.
Code: Select all
MaterialPtr material = MaterialManager::getSingleton().create("Material_Test",ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
ColourValue test(1.0f,0.2f,0.5f,0.5f);
material->getTechnique(0)->getPass(0)->setDiffuse(test);
Entity* temp=mSystem->o_get_by_name("sprite");
temp->setMaterialName("Material_Test");
Thanks in advance