mirror of
https://github.com/SFML/SFML.git
synced 2024-11-29 06:41:05 +08:00
Remove deprecated overload of 'RenderWindow::capture'
This commit is contained in:
parent
e7a5039cd9
commit
0e28212584
@ -141,33 +141,6 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
bool setActive(bool active = true) override;
|
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:
|
protected:
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
@ -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()
|
void RenderWindow::onCreate()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user