SFML community forums
Help => Graphics => Topic started by: hilnius on October 28, 2012, 02:48:43 am
-
Hi,
Im using the CSFML binding and caml-light on a project, and i'd like to know whi it takes 0.3 seconds to render 12*18=216 sprites.
if this update time is normal then how to update just a part of the window ?
thanks
hilnius
-
finallt, that was something stupid : i'm running on a VM that does not use my graphic card.
-
how to update just a part of the window ?
Well I found that you can update just part of the window by simply drawing over it without clearing:
You could basically "clear" parts using sf::RectangleShape or even sf::CircleShape of your desired size and colour.
EDIT: read Laurent's comments in the posts beneath. This method is "not reliable".
-
Well I found that you can update just part of the window by simply drawing over it without clearing:
You could basically "clear" parts using sf::RectangleShape or even sf::CircleShape of your desired size and colour.
Wrong. Never do that ;)
-
But why Laurent? It worked for me and I never got any memleaks, could you explain why it is wrong to do so?
-
You shouldn't expect pixels rendered previously to be valid in the current frame. For example, with double-buffering, you would get the pixels rendered two frames ago.
It might work in certain circumstances, but it's not clean/reliable. And it's not necessary.