From 0e28212584a6913081fb6d1f2c9fc338b4a32062 Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Thu, 9 Dec 2021 00:49:12 +0000 Subject: [PATCH] Remove deprecated overload of 'RenderWindow::capture' --- include/SFML/Graphics/RenderWindow.hpp | 27 -------------------------- src/SFML/Graphics/RenderWindow.cpp | 13 ------------- 2 files changed, 40 deletions(-) diff --git a/include/SFML/Graphics/RenderWindow.hpp b/include/SFML/Graphics/RenderWindow.hpp index 781dace80..fedfff42b 100644 --- a/include/SFML/Graphics/RenderWindow.hpp +++ b/include/SFML/Graphics/RenderWindow.hpp @@ -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: //////////////////////////////////////////////////////////// diff --git a/src/SFML/Graphics/RenderWindow.cpp b/src/SFML/Graphics/RenderWindow.cpp index 3dc4b6dd8..179b17892 100644 --- a/src/SFML/Graphics/RenderWindow.cpp +++ b/src/SFML/Graphics/RenderWindow.cpp @@ -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() {