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

Author Topic: Should I check if images are on the screen before I render them?  (Read 1510 times)

0 Members and 1 Guest are viewing this topic.

foobarbaz

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Hi, all, I'm just wondering if it is necessary to check if graphics are actually on the screen before trying to render them? I have a lot of sprites and sf::VertexArrays in my game, and the vast majority of them aren't on the screen at any given time, so does SFML automatically handle this? Or is this something I should do on my own? The game doesn't lag at all, but I figure that I might as well optimize everything that I can.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Should I check if images are on the screen before I render them?
« Reply #1 on: May 28, 2013, 03:27:31 am »
For large amounts of objects, yes, you should. For small it doesn't matter. SFML has no functionality to skip rendering of objects that are out of view/screen/etc.
Back to C++ gamedev with SFML in May 2023

foobarbaz

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Should I check if images are on the screen before I render them?
« Reply #2 on: May 28, 2013, 05:48:08 am »
Cool, thanks.

 

anything