Thanks for the reply.
Yes, I meant vertexArray
. Sorry, it was like 4 AM. I have used vertex arrays but just to draw simple lines (using sf::LinesStrip).
And yes, I haven't read the tutorial, I didn't know there was one about it. Now I found it; how silly of me, sorry about that.
Thanks for the explanation; switching textures really slows things down. Unfortunely I can't minimize texture switching because the sprites need to be drawn in a particular order.
My PC? An HP laptop using Windows 7 64 bits, 3 GB Ram, a 2 GHz Intel Core 2 Duo CPU, and a lame integrated Intel graphics card ("Mobile Intel 4 Series ECF") that uses 1GB of memory and can handle textures up to 2K x 2K and all drivers up to date. While the graphics card is pretty bad, I don't think its that bad to struggle with 30 sprites, isn't it?
One thing I didn't mention (as I thought it was irrelevant) is that all my 30 or so sprites are not stored in a single list. I use 4 or 5 lists, each one having the sprites from a different layer (background, foreground, etc) and each layer has their own camera (so I can move them at different speeds to create parallax scrolling), although I don't think the cameras nor the amount of lists are the problem, but I could be wrong.
The textures are not necessarily 400x400; some are slighty different, but that's more or less the average.
Finally, if I change the resolution (from 1280x800 to 800x600) but keeping the camera size the same so I can see the same on screen, I get better performance. So yeah, maybe it's my PC or I'm using sprites that are way too big, I don't know.
I can't provide you with code right now, but I load the textures and set up my sprites and cameras outside of the main loop, and inside the loop I just iterate through each "layer" by setting up the respective camera to my window first, and then drawing one by one the sprites of that layer. I don't think I'm doing anything redundant, to be honest.
Thanks for your time