I noticed today that sf::Image::CopyWindow has been replaced by sf::RenderWindow::Capture().
I wanted to ask how to use this function efficiently, given the performance overhead of copying an image.
Is there something better than this:
sf::Image screenshot = Window.Capture();
I know the copy related to the return of an sf::Image can be optimised out, but how can I get around the overhead of the assignment operation?
I suppose I could do this:
sf::Image& screenshot = Window.Capture();
but in some circumstances I imagine there would be issues of scope/lifetime of the returned temporary.