Hey my friends I have a really big spritesheet and wanted to ask about the performance difference between loading a lot of textures from parts of it and loading the full texture one time and setting the IntRect when giving it to a sprite.
Like this pseudocode:
loadFromFile(spritesheetPath, IntRect(184, 108, 13, 16));
loadFromFile(spritesheetPath, IntRect(168, 108, 14, 18));
loadFromFile(spritesheetPath, IntRect(634, 24, 122, 25));
// and so on
vs.
loadFromFile(spritesheet);
sprite1.setTexture(spritesheet, IntRect(184, 108, 13, 16))
sprite2.setTexture(spritesheet, IntRect(168, 108, 14, 18))
sprite3.setTexture(spritesheet, IntRect(634, 24, 122, 25))
// and so on
The second method would be very inconvenient because of the way my Resource Manager is structured but I don't want do loose too much performance when loading
lots of textures.
Thanks for your Answers
Daniel