diff --git a/include/CSFML/Graphics/Texture.h b/include/CSFML/Graphics/Texture.h index c9fde23..7018799 100644 --- a/include/CSFML/Graphics/Texture.h +++ b/include/CSFML/Graphics/Texture.h @@ -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 /// diff --git a/src/CSFML/Graphics/Texture.cpp b/src/CSFML/Graphics/Texture.cpp index 4ddc5cc..881f8d9 100644 --- a/src/CSFML/Graphics/Texture.cpp +++ b/src/CSFML/Graphics/Texture.cpp @@ -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) {