SFML community forums
Help => Graphics => Topic started by: RaptorIV on November 04, 2011, 08:16:55 pm
-
Is it possible to remove a single DrawableObject from the render window rather than clear the whole thing every time? Seems inefficient in larger applications
-
Nop. This is how things work, don't worry about that.
-
So redrawing the whole frame is not taxing? Sorry, the scholar inside me dislikes the response "don't worry about that"
-
So redrawing the whole frame is not taxing? Sorry, the scholar inside me dislikes the response "don't worry about that"
Instead of changing the methods sfml draw the window, learn to manage the methods your project uses to draw a window. Could be as simple as If(DrawPlayer)(Window.Draw(Player));
-
The thing is: The rendered image is not layered, so if something is printed in front of another thing, that another thing gets replaced on those pixels. There is no coming back, as there is no changing history nor layers.
The best you can do is redraw only what was behind the removed image, but if there was something on top of it, will get replaced as well. And so on.
The simplier and more doable thing is to redraw everyting each frame, which is not very costly for something like 60 FPS, depending on the number of drawable instances. Everyone does just that.
-
The thing is: The rendered image is not layered, so if something is printed in front of another thing, that another thing gets replaced on those pixels. There is no coming back, as there is no changing history nor layers.
The best you can do is redraw only what was behind the removed image, but if there was something on top of it, will get replaced as well. And so on.
The simplier and more doable thing is to redraw everyting each frame, which is not very costly for something like 60 FPS, depending on the number of drawable instances. Everyone does just that.
ahh thank you