1
Graphics / Re: Drawing to a sf::RenderTexture causing memory leak.
« on: May 23, 2015, 10:42:11 am »What you should take away from my post is that you are probably creating/destroying too many sf::RenderTextures. How you do it is irrelevant. If you create/destroy the object which contains the sf::RenderTexture every frame, it is not much different to what you are doing now. If you are sure that you aren't creating/destroying a lot of sf::RenderTextures repeatedly and are still experiencing a memory leak, then like zsbzsb said, you will need to post a complete and minimal example for us to test.
Thank you, i thought i had to call sf::RenderTexture::create every frame in case window is resized. Now i just call it once each time the window is resized. Memory is stable once again. But i suspect it will leak small amounts each time the window is resized.
PS. You was also right performance has increased lots. Drawing up to 2025 (1920*1080 screen 32px tiles) sprites to the texture and drawing that to the window now takes 1-4ms when it used to take 30-40ms which is amazing.
Thanks again.