Hi, I'm trying to make a namespace that can load in textures, I have made it load in sf::music, but I can't make it load in textures because it gives me an error saying no suitable conversion from sf::texture to const sf::texture exists here is my code:
//other namespace stuff
namespace Resource {
static void loadTextureFromFile(sf::Texture& Texture, std::string FileName){
if (!Texture.loadFromFile(FileName)){
std::cout << "ERROR could not load " << FileName << std::endl;
}
else{
std::cout << "Loaded" << FileName << std::endl;
}
}
//other namespace stuff
}
sf::RectangleShape MShape;
Resource::loadTextureFromFile(MenuBackGround, "Background.jpg");
MShape.setTexture(MenuBackGround);//error line
thanks in advance!!!