Added polymorphism to the setTexture function.