Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SFML2.0] sf::Shape vs. sf::Sprite  (Read 4187 times)

0 Members and 1 Guest are viewing this topic.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
[SFML2.0] sf::Shape vs. sf::Sprite
« 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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[SFML2.0] sf::Shape vs. sf::Sprite
« Reply #1 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.
Laurent Gomila - SFML developer

 

anything