From 4418469d97e330812b71f2de73ff6ebb030d6df1 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Thu, 3 Dec 2009 08:29:35 +0000 Subject: [PATCH] Added SetSmooth / IsSmooth to sf::RenderImage git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1299 4e206d99-4929-0410-ac5d-dfc041789085 --- include/SFML/Graphics/RenderImage.hpp | 17 +++++++++++++++++ src/SFML/Graphics/RenderImage.cpp | 22 ++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/include/SFML/Graphics/RenderImage.hpp b/include/SFML/Graphics/RenderImage.hpp index 8791015b1..344df174d 100644 --- a/include/SFML/Graphics/RenderImage.hpp +++ b/include/SFML/Graphics/RenderImage.hpp @@ -72,6 +72,23 @@ public : //////////////////////////////////////////////////////////// bool Create(unsigned int width, unsigned int height, bool depthBuffer = false); + //////////////////////////////////////////////////////////// + /// Enable or disable image smooth filter. + /// This parameter is enabled by default + /// + /// \param smooth : True to enable smoothing filter, false to disable it + /// + //////////////////////////////////////////////////////////// + void SetSmooth(bool smooth); + + //////////////////////////////////////////////////////////// + /// Tells whether the smooth filtering is enabled or not + /// + /// \return True if image smoothing is enabled + /// + //////////////////////////////////////////////////////////// + bool IsSmooth() const; + //////////////////////////////////////////////////////////// /// Activate of deactivate the render-image as the current target /// for rendering diff --git a/src/SFML/Graphics/RenderImage.cpp b/src/SFML/Graphics/RenderImage.cpp index 7fbdcb462..7d9d349aa 100644 --- a/src/SFML/Graphics/RenderImage.cpp +++ b/src/SFML/Graphics/RenderImage.cpp @@ -72,8 +72,8 @@ bool RenderImage::Create(unsigned int width, unsigned int height, bool depthBuff return false; } - // Disable smoothing -- we don't want to alter the original rendering - myImage.SetSmooth(false); + // We disable smoothing by default for render images + SetSmooth(false); // Create the implementation delete myRenderImage; @@ -99,6 +99,24 @@ bool RenderImage::Create(unsigned int width, unsigned int height, bool depthBuff } +//////////////////////////////////////////////////////////// +/// Enable or disable image smoothing filter +//////////////////////////////////////////////////////////// +void RenderImage::SetSmooth(bool smooth) +{ + myImage.SetSmooth(smooth); +} + + +//////////////////////////////////////////////////////////// +/// Tells whether the smooth filtering is enabled or not +//////////////////////////////////////////////////////////// +bool RenderImage::IsSmooth() const +{ + return myImage.IsSmooth(); +} + + //////////////////////////////////////////////////////////// /// Activate of deactivate the render-image as the current target /// for rendering