Exploiter, I had an example at the top. Here's another shot at being more thorough:
EDIT: More code...
This is from Player class. units is a vector of all units a player will have.
void Player::PlayerInit(){
Unit newUnit("Alien.png");
units.push_back(newUnit);
}
Unit::Unit(string FP){
filePath = "images/" + FP;
if (!localTexture.loadFromFile(filePath)){
return;}
}
void Unit::displaySprite(sf::RenderWindow& window){
localSprite.setPosition(xLoc, yLoc);
localSprite.setTexture(localTexture);
window.draw(localSprite);
}
Both snippets are from the class "Unit.cpp" I know that I am using the correct class instances because xLoc and yLoc are being set correctly in another function.
Now, let me be clear - the above works, but only the FIRST time I create a new "Unit" instance. When I create more units, the picture is just ... gone. I call loadFromFile on localTexture, it does not fail, which is why it seems like something is stopping me from accessing the same resource
I am trying my best to follow the guidelines ... minimal and complete.