Implement resize for Texture

This commit is contained in:
Shane Whitmire authored and Chris Thrasher committed 2025-06-08 22:03:49 -06:00
1 parent e39a0b1ab8
commit 8f44a6f424
2 files changed
+23

No files matched your search

+14
View File
@@ -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
///
+9
View File
@@ -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)
{