mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Add getter for sf::Texture::m_pixelsFlipped
This commit is contained in:
parent
da1f652c22
commit
4ca8dd117c
@ -711,6 +711,14 @@ public:
|
||||
////////////////////////////////////////////////////////////
|
||||
[[nodiscard]] static unsigned int getMaximumSize();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the state of whether the Y orientatino of pixels are flipped
|
||||
///
|
||||
/// \return `true` if pixels are flipped, otherwise `false`
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
[[nodiscard]] bool getPixelsFlipped() const;
|
||||
|
||||
private:
|
||||
friend class Text;
|
||||
friend class RenderTexture;
|
||||
|
@ -1005,6 +1005,13 @@ unsigned int Texture::getMaximumSize()
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
bool Texture::getPixelsFlipped() const
|
||||
{
|
||||
return m_pixelsFlipped;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
Texture& Texture::operator=(const Texture& right)
|
||||
{
|
||||
|
@ -131,6 +131,7 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests())
|
||||
CHECK(!texture.isSrgb());
|
||||
CHECK(!texture.isRepeated());
|
||||
CHECK(texture.getNativeHandle() == 0);
|
||||
CHECK(!texture.getPixelsFlipped());
|
||||
}
|
||||
|
||||
SECTION("Assignment")
|
||||
@ -143,6 +144,7 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests())
|
||||
CHECK(!texture.isSrgb());
|
||||
CHECK(!texture.isRepeated());
|
||||
CHECK(texture.getNativeHandle() == 0);
|
||||
CHECK(!texture.getPixelsFlipped());
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,6 +159,7 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests())
|
||||
CHECK(!texture.isSrgb());
|
||||
CHECK(!texture.isRepeated());
|
||||
CHECK(texture.getNativeHandle() != 0);
|
||||
CHECK(!texture.getPixelsFlipped());
|
||||
}
|
||||
|
||||
SECTION("Assignment")
|
||||
@ -169,6 +172,7 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests())
|
||||
CHECK(!texture.isSrgb());
|
||||
CHECK(!texture.isRepeated());
|
||||
CHECK(texture.getNativeHandle() != 0);
|
||||
CHECK(!texture.getPixelsFlipped());
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,6 +210,7 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests())
|
||||
CHECK(!texture.isSrgb());
|
||||
CHECK(!texture.isRepeated());
|
||||
CHECK(texture.getNativeHandle() != 0);
|
||||
CHECK(!texture.getPixelsFlipped());
|
||||
}
|
||||
|
||||
SECTION("loadFromMemory()")
|
||||
@ -218,6 +223,7 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests())
|
||||
CHECK(!texture.isSrgb());
|
||||
CHECK(!texture.isRepeated());
|
||||
CHECK(texture.getNativeHandle() != 0);
|
||||
CHECK(!texture.getPixelsFlipped());
|
||||
}
|
||||
|
||||
SECTION("loadFromStream()")
|
||||
@ -231,6 +237,7 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests())
|
||||
CHECK(!texture.isSrgb());
|
||||
CHECK(!texture.isRepeated());
|
||||
CHECK(texture.getNativeHandle() != 0);
|
||||
CHECK(!texture.getPixelsFlipped());
|
||||
}
|
||||
|
||||
SECTION("loadFromImage()")
|
||||
@ -268,6 +275,7 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests())
|
||||
}
|
||||
|
||||
CHECK(texture.getNativeHandle() != 0);
|
||||
CHECK(!texture.getPixelsFlipped());
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,6 +300,8 @@ TEST_CASE("[Graphics] sf::Texture", runDisplayTests())
|
||||
REQUIRE(textureCopy.getSize() == sf::Vector2u(1, 2));
|
||||
CHECK(textureCopy.copyToImage().getPixel(sf::Vector2u(0, 1)) == sf::Color::Red);
|
||||
}
|
||||
|
||||
CHECK(!texture.getPixelsFlipped());
|
||||
}
|
||||
|
||||
SECTION("update()")
|
||||
|
Loading…
Reference in New Issue
Block a user