Rewrite RenderWindow::capture to make use of a single texture transfer instead of transferring each row of the framebuffer individually.
This commit is contained in:
parent
146f63874a
commit
043fb83cd8
2 changed files with 18 additions and 18 deletions
|
@ -115,6 +115,17 @@ public:
|
|||
////////////////////////////////////////////////////////////
|
||||
/// \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
|
||||
|
@ -126,7 +137,7 @@ public:
|
|||
/// \return Image containing the captured contents
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Image capture() const;
|
||||
SFML_DEPRECATED Image capture() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue