I'm coding a simple game using SFML in Xcode. I have a .png of a block I want to use in a sprite. At the moment, I have to type the full path to the image in the code snippet below:
sf::Image blockImage;
if (!blockImage.LoadFromFile("/Users/me/Development/Tetris/images/block.png")) {
cerr << "Could not load block image." << endl;
App.Close();
}
I'd rather not have to hard code the location of every image in my game like this. I know Xcode projects can have 'Resources', but I've never used this before, and from what I've been able to Google it only matters for projects that use Apple's frameworks. Can I add my image as a resource? How would I actually get its location and use it in my code?
Thanks!