hey thanks, passing works great. but i noticed you can also just load the texture in the initialization like that:
Game::Game():
mPlayerTexture("resources/eagle.png"),
mPlayer(mPlayerTexture) {}
I dont get how std::optional is supposed to work tho. if i use it in the header it dosnt really help because it wont allow me to use move() or draw() on that sprite because its not recognized as an sf::Sprite.
And now i built a simple texture manager with the guidance of a sfml book which loads the texture into a std::map with a pointer to retrieve it like that:
textures.Load(Textures::Airplane, "resources/eagle.png");
mPlayer(textures.Get(Textures::Airplane));
So i have now the same problem a third time D:
cant do that in the initialization and i cannot use it in the constructor.