Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added repeating to sf::RenderTexture #363

Merged
merged 1 commit into from

3 participants

@Foaly

Added the missing setRepeated() and isRepeated() methods to sf::RenderTexture.
I worked on a little project that needed repeated renderTexture's so I added the two methods. It's tested and works. Since it has been requested a couple times on the forum I though I share my code.

@Foaly Foaly Added repeating to sf::RenderTexture
Added the missing setRepeated() and isRepeated() methods to sf::RenderTexture.
ba2d086
@LaurentGomila LaurentGomila was assigned
@LaurentGomila LaurentGomila merged commit f5b9c7e into SFML:master
@Foaly Foaly deleted the Foaly:repeatedRenderTexture branch
@krofna

? Purpose ?

@LaurentGomila

Purpose of what???

@krofna

Of isRepeated flag.
EDIT: nevermind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 6, 2013
  1. @Foaly

    Added repeating to sf::RenderTexture

    Foaly authored
    Added the missing setRepeated() and isRepeated() methods to sf::RenderTexture.
This page is out of date. Refresh to see the latest.
View
23 include/SFML/Graphics/RenderTexture.hpp
@@ -109,6 +109,29 @@ public :
bool isSmooth() const;
////////////////////////////////////////////////////////////
+ /// \brief Enable or disable texture repeating
+ ///
+ /// This function is similar to Texture::setRepeated.
+ /// This parameter is disabled by default.
+ ///
+ /// \param repeated True to enable repeating, false to disable it
+ ///
+ /// \see isRepeated
+ ///
+ ////////////////////////////////////////////////////////////
+ void setRepeated(bool repeated);
+
+ ////////////////////////////////////////////////////////////
+ /// \brief Tell whether the texture is repeated or not
+ ///
+ /// \return True if texture is repeated
+ ///
+ /// \see setRepeated
+ ///
+ ////////////////////////////////////////////////////////////
+ bool isRepeated() const;
+
+ ////////////////////////////////////////////////////////////
/// \brief Activate of deactivate the render-texture for rendering
///
/// This function makes the render-texture's context current for
View
14 src/SFML/Graphics/RenderTexture.cpp
@@ -100,6 +100,20 @@ bool RenderTexture::isSmooth() const
////////////////////////////////////////////////////////////
+void RenderTexture::setRepeated(bool repeated)
+{
+ m_texture.setRepeated(repeated);
+}
+
+
+////////////////////////////////////////////////////////////
+bool RenderTexture::isRepeated() const
+{
+ return m_texture.isRepeated();
+}
+
+
+////////////////////////////////////////////////////////////
bool RenderTexture::setActive(bool active)
{
return m_impl && m_impl->activate(active);
Something went wrong with that request. Please try again.