SFML community forums

Help => Graphics => Topic started by: eXpl0it3r on January 04, 2012, 04:38:49 pm

Title: [SFML2.0] sf::Shape vs. sf::Sprite
Post by: eXpl0it3r on January 04, 2012, 04:38:49 pm
I was just looking at the SFML 2.0 API with the merged drawables and noticed that sf::Shape and sf::Sprite kinda do the same thing.
Sure Sprites can't have an outer color but the rest seems equally on the top.
Now I was wondering what's diffrent at the bottom and which would perform better (theoreticly). I could figure it out and test it myself but ... I'm too lazy.  :lol:
Is it now just a question of desgin and/or taste or are there some real advantages?
Title: [SFML2.0] sf::Shape vs. sf::Sprite
Post by: Laurent on January 04, 2012, 04:51:46 pm
If you want a textured quad, sf::Sprite is better, since that's exactly what it's made for.

A textured quad with sf::Shape would just be a special case of something more generic, and thus less optimized.

But with the new API, both are just high-level helpers on top of vertex arrays anyway. So If you really really want maximum performances, use vertex arrays directly.