Hi, I have a question about a way of drawing things. In my application, I
draw things like this:
- Load all the sprites and backgrounds into a vector
- Set the current background
- Set the visibility of sprites (show or hide)
- Blit the current background
- Blit the visible (unhidden) sprites and ignore the hidden sprites
recursively in the vector - Flip the surface
I was wondering, should I stick with this or should I do it like this:
- Load all the sprites and backgrounds into a vector
- Set the current background
- Make a drawing queue from the sprites (take the sprites’ pointers from
the vector and push it into a queue) - Blit the current background
- Blit sprites from the queue
- Flip the surface
- Clear the queue
I know that in the second one, I can draw things in any order I want
whereas in the first one, the order is strictly from the order the sprites
were pushed. But, which one is faster?
Thanks in advance.