Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions include/CSFML/Graphics/Texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions src/CSFML/Graphics/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
Loading