mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-24 21:53:37 +02:00
Split texture's resize function into sRGB and non-sRGB
This commit is contained in:
1 parent
08b22ee975
commit
a800f76d5e
2 files changed
+25
-4
No files matched your search
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user