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

Author Topic: Drawing out of screen  (Read 187 times)

0 Members and 1 Guest are viewing this topic.

wdmitry

  • Newbie
  • *
  • Posts: 11
    • View Profile
Drawing out of screen
« on: November 22, 2023, 07:33:18 am »
Should I detect that the graphics is out of main view and therefor disable the draw code or it is done automatically?

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Drawing out of screen
« Reply #1 on: November 22, 2023, 02:31:16 pm »
If you can, you should consider it. It's not automatically ignored - the draw calls are still made - but if it's outside of the window/viewport, it'll not be shown.

For things where there isn't too much outside of the window, this shouldn't be so necessary but if it's, for example, a large map where you only show a small part of it, consider "culling" the parts of the map outside of the visible area.

Feel free to check out Cheese Map, an automatic map drawer with automatic culling designed for SFML and for just this situation.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything