SFML community forums

Help => Graphics => Topic started by: gws923 on December 09, 2016, 05:14:06 am

Title: How many is "a lot" of sf::Sprites?
Post by: gws923 on December 09, 2016, 05:14:06 am
From the FAQ:

"My FPS count drops when drawing a lot of sprites."

How many is "a lot?"  I feel like I might be reaching that point, but I've probably got about... 100-200 sprites in my level?

Related question: does SFML ignore my draw() calls if whatever I'm drawing isn't on screen?
Title: Re: How many is "a lot" of sf::Sprites?
Post by: Laurent on December 09, 2016, 07:30:15 am
200 sprites is not a lot, unless you have a really old machine with crappy graphics drivers.

Quote
does SFML ignore my draw() calls if whatever I'm drawing isn't on screen?
Nop, SFML does nothing. A common optimization is to avoid drawing what's not visible, to save bandwidth and GPU processing.
Title: Re: How many is "a lot" of sf::Sprites?
Post by: gws923 on December 09, 2016, 08:03:17 am
Awesome.  Both answers are just what I wanted to hear.  Thank you, Laurent!