SFML community forums

Help => Window => Topic started by: Kernelpanic on May 30, 2008, 02:47:52 pm

Title: [Solved] Drawing outside of the window
Post by: Kernelpanic 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?
Title: [Solved] Drawing outside of the window
Post by: Laurent 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.
Title: [Solved] Drawing outside of the window
Post by: Kernelpanic 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)
Title: [Solved] Drawing outside of the window
Post by: Laurent 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.
Title: [Solved] Drawing outside of the window
Post by: Kernelpanic 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!