Remove deprecated overload of 'RenderWindow::capture'

This commit is contained in:
Vittorio Romeo 2021-12-09 00:49:12 +00:00
parent e7a5039cd9
commit 0e28212584
2 changed files with 0 additions and 40 deletions

View File

@ -141,33 +141,6 @@ public:
////////////////////////////////////////////////////////////
bool setActive(bool active = true) override;
////////////////////////////////////////////////////////////
/// \brief Copy the current contents of the window to an image
///
/// \deprecated
/// Use a sf::Texture and its sf::Texture::update(const Window&)
/// function and copy its contents into an sf::Image instead.
/// \code
/// sf::Vector2u windowSize = window.getSize();
/// sf::Texture texture;
/// texture.create(windowSize.x, windowSize.y);
/// texture.update(window);
/// sf::Image screenshot = texture.copyToImage();
/// \endcode
///
/// This is a slow operation, whose main purpose is to make
/// screenshots of the application. If you want to update an
/// image with the contents of the window and then use it for
/// drawing, you should rather use a sf::Texture and its
/// update(Window&) function.
/// You can also draw things directly to a texture with the
/// sf::RenderTexture class.
///
/// \return Image containing the captured contents
///
////////////////////////////////////////////////////////////
[[deprecated]] Image capture() const;
protected:
////////////////////////////////////////////////////////////

View File

@ -102,19 +102,6 @@ bool RenderWindow::setActive(bool active)
}
////////////////////////////////////////////////////////////
Image RenderWindow::capture() const
{
Vector2u windowSize = getSize();
Texture texture;
texture.create(windowSize.x, windowSize.y);
texture.update(*this);
return texture.copyToImage();
}
////////////////////////////////////////////////////////////
void RenderWindow::onCreate()
{