You can have multiple textures and switch between them as and when required. The one you use shouldn't cause any lag if it's still just one at a time (instead of multiple textures just for the player, for example) although if may not be as optimised as using the same texture as the objects drawn before and after it; it also reduces ability to batch stuff.
So, yes, you can just change which texture to use. You can use different textures for different things if needed.
If you have a limit of how many textures you can have at once (for whatever reason), you could store images and swap textures in and out. Note that this is slower and should only be done occasionally.
I heard something about it being possible to load large textures using vertices. Is this correct?
I'm not exactly sure what this means so to clarify:
- Images are a pixel array stored in memory. This holds the data of the image (pixel colours). This is limited only be size of RAM.
- Textures are similar to Images but are stored on the graphics card's memory. This can be accessed by drawing operations. The limit to the size of a Texture is determined by the graphics card.*
- Sprites (or other Vertex arrays that show textures) show a part of a texture. For a Sprite, this is rectangular. Their appearance's size is limitless. For a Sprite, you change its size using its Scale.
So, a texture is a rectangular image that is stored on the graphics card that can be used while drawing.
One issue that sometimes occurs is that you may want to show an image larger than you can store in any one image. For this, you can use multiple textures and stitch them together; basically, it's just drawing multiple things together.
The Thor library can do this automatically for you.However, it doesn't sound like you're trying to draw a large texture, rather can't fit all frames of an animation on the same texture. This is absolutely not an issue; you can simply put some frames on one texture and some on another and just change which texture to use when you draw it. For example, with a Sprite, you'd just set its texture at the time when you set its texture rectangle.
*To determine the largest possible texture that you graphics card can use, you can use SFML:
const unsigned int maxTextureSize{ sf::Texture::getMaximumSize() };
Note that this is a one-dimensional length. The texture size is a square area with this length for both dimensions; its size is (maxTextureSize x maxTextureSize).
This can help you determine the size of the images you create externally but be aware that this can be different for different devices so may need to account for different sizes if you intend for others to use it.