SFML community forums

General => Feature requests => Topic started by: lamogui on July 02, 2015, 09:30:40 am

Title: sf::RenderTexture::getPixels(sf::Uint8*)
Post by: lamogui on July 02, 2015, 09:30:40 am
Hi

If I remember well there was a function that allow to take screenshot of RenderWindow in previous verions of SFML (http://www.sfml-dev.org/documentation/1.6/classsf_1_1RenderWindow.php#a7066f80705fb53c2c4a9fe068fc47a8a) (I can't find it at http://www.sfml-dev.org/documentation/2.3-fr/classsf_1_1RenderWindow.php).

I think that could be cool to have this function again.
  :-X

With the FBO support it could be interesting to extend the function in sf::RenderTexture. (using glReadPixels). It can also be supported for "classic" RenderTextures using glTexImage.
Btw I could be interesting to make public the function priv::RenderTextureImplFBO::isAvailable().

I need this functionnality so whatever you decide I will begin to develop something here https://github.com/lamogui/SFML

Sorry for my bad english.








Title: Re: sf::RenderTexture::getPixels(sf::Uint8*)
Post by: eXpl0it3r on July 02, 2015, 12:51:44 pm
I assume you've found sf::RenderWindow::capture() (http://www.sfml-dev.org/documentation/2.3/classsf_1_1RenderWindow.php#a9bd8655d0bac83145bfc329ea7a6d538) and sf::Texture::copyToImage() (http://www.sfml-dev.org/documentation/2.3/classsf_1_1Texture.php#aefc19bcd95565dd2348fd4cec0facddc) via sf::RenderTexture::getTexture() (http://www.sfml-dev.org/documentation/2.3/classsf_1_1RenderTexture.php#a95bc5152c497066d31fdc57da8e17678) then. ;)