Why not use a textures.txt file or something?
Just edit the file whenever you want to change textures. It'll remove a platform-dependent filesystem API usage.
Kinda like this?
texture1.png
someothertexture.png
somethingelse.png
...
Then in your code:
std::string filename{ "" };
std::ifstream file("path_to_textures.txt");
while (file >> filename) {
my_textures.push_back({});
if (!my_textures.back().loadFromFile(filename))
report error
}
Why not use a textures.txt file or something?
Just edit the file whenever you want to change textures. It'll remove a platform-dependent filesystem API usage.
Kinda like this?
texture1.png
someothertexture.png
somethingelse.png
...
Then in your code:
std::string filename{ "" };
std::ifstream file("path_to_textures.txt");
while (file >> filename) {
my_textures.push_back({});
if (!my_textures.back().loadFromFile(filename))
report error
}
Cool solution, although it still requires some effort from the user. I think it's worth it though. Will try when I get the chance, many thanks!