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