Split texture's resize function into sRGB and non-sRGB

This commit is contained in:
Lukas Dürrenberger committed 2025-08-31 17:26:12 +02:00
1 parent 08b22ee975
commit a800f76d5e
2 files changed
+25 -4

No files matched your search

+14 -2
View File
@@ -185,12 +185,24 @@ CSFML_GRAPHICS_API void sfTexture_destroy(const sfTexture* texture);
///
/// \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);
CSFML_GRAPHICS_API bool sfTexture_resize(sfTexture* texture, sfVector2u size);
////////////////////////////////////////////////////////////
/// \brief Resize the texture with sRGB-enabled
///
/// If this function fails, the texture is left unchanged.
///
/// \param texture Texture to resize
/// \param size Width and height of the texture
///
/// \return `true` if resizing was successful, `false` if it failed
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API bool sfTexture_resizeSrgb(sfTexture* texture, sfVector2u size);
////////////////////////////////////////////////////////////
/// \brief Return the size of the texture
+11 -2
View File
@@ -171,11 +171,20 @@ void sfTexture_destroy(const sfTexture* texture)
////////////////////////////////////////////////////////////
bool sfTexture_resize(sfTexture* texture, sfVector2u size, bool sRgb)
bool sfTexture_resize(sfTexture* texture, sfVector2u size)
{
assert(texture);
assert(texture->This);
return texture->This->resize(convertVector2(size), sRgb);
return texture->This->resize(convertVector2(size), false);
}
////////////////////////////////////////////////////////////
bool sfTexture_resizeSrgb(sfTexture* texture, sfVector2u size)
{
assert(texture);
assert(texture->This);
return texture->This->resize(convertVector2(size), true);
}