mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-24 13:53:36 +02:00
Implement resize for Texture
This commit is contained in:
1 parent
e39a0b1ab8
commit
8f44a6f424
2 files changed
+23
No files matched your search
@@ -178,6 +178,20 @@ CSFML_GRAPHICS_API sfTexture* sfTexture_copy(const sfTexture* texture);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTexture_destroy(const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Resize the texture
|
||||
///
|
||||
/// If this function fails, the texture is left unchanged.
|
||||
///
|
||||
/// \param texture Texture to resize
|
||||
/// \param size Width and height of the texture
|
||||
/// \param sRgb `true` to enable sRGB conversion, `false` to disable it
|
||||
///
|
||||
/// \return `true` if resizing was successful, `false` if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API bool sfTexture_resize(sfTexture* texture, sfVector2u size, bool sRgb);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Return the size of the texture
|
||||
///
|
||||
|
||||
@@ -170,6 +170,15 @@ void sfTexture_destroy(const sfTexture* texture)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
bool sfTexture_resize(sfTexture* texture, sfVector2u size, bool sRgb)
|
||||
{
|
||||
assert(texture);
|
||||
assert(texture->This);
|
||||
return texture->This->resize(convertVector2(size), sRgb);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfVector2u sfTexture_getSize(const sfTexture* texture)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user