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

Author Topic: [Solved] Drawing outside of the window  (Read 3184 times)

0 Members and 1 Guest are viewing this topic.

Kernelpanic

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • http://eisenholz.bplaced.net
[Solved] Drawing outside of the window
« on: May 30, 2008, 02:47:52 pm »
When I call RenderWindow::Draw, would it be usefull to check, if the coordinates are outside of the window or is there any automatically checking?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[Solved] Drawing outside of the window
« Reply #1 on: May 30, 2008, 03:12:23 pm »
SFML does no automatic culling, so it might be worth doing it if your application is not CPU bound.
Laurent Gomila - SFML developer

Kernelpanic

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • http://eisenholz.bplaced.net
[Solved] Drawing outside of the window
« Reply #2 on: May 30, 2008, 03:21:37 pm »
Okay, so RenderWindow::Draw takes graficpower, althoug the coordinates are out of the window, am I right?
I will insert some ifs. (I want to make some gui-classes)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
[Solved] Drawing outside of the window
« Reply #3 on: May 30, 2008, 03:32:21 pm »
First make sure you really need it, sometimes it will be faster to directly send a few invisible sprites rather than using some CPU power to discard them. Especially if your GPU spends most of its time doing nothing (which is usually the case), you can feed it with useless stuff ;)

If it's just for a GUI, I don't think you need this kind of optimization.
Laurent Gomila - SFML developer

Kernelpanic

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
    • http://eisenholz.bplaced.net
[Solved] Drawing outside of the window
« Reply #4 on: May 30, 2008, 03:40:47 pm »
:D
Okay, I will see.
I think I will make a function like OptimizeForSlowGPU(bool) setting a pointer to the function with the if.

Thank you, Laurent!