Implement sf::Image::saveToMemory

https://github.com/SFML/SFML/pull/1669

Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
This commit is contained in:
kimci86andChris Thrasher authored and Lukas Dürrenberger committed 2023-09-09 23:36:24 +02:00
1 parent 39dd578d45
commit 725811baa9
2 files changed
+32

No files matched your search

+10
View File
@@ -27,9 +27,11 @@
////////////////////////////////////////////////////////////
#include <SFML/Graphics/Image.h>
#include <SFML/Graphics/ImageStruct.h>
#include <SFML/System/BufferStruct.h>
#include <SFML/Internal.h>
#include <SFML/CallbackStream.h>
////////////////////////////////////////////////////////////
sfImage* sfImage_create(unsigned int width, unsigned int height)
{
@@ -131,6 +133,14 @@ sfBool sfImage_saveToFile(const sfImage* image, const char* filename)
}
////////////////////////////////////////////////////////////
sfBool sfImage_saveToMemory(const sfImage* image, sfBuffer* output, const char* format)
{
CSFML_CHECK_RETURN(output, sfFalse);
CSFML_CALL_RETURN(image, saveToMemory(output->buffer, format), sfFalse);
}
////////////////////////////////////////////////////////////
void sfImage_createMaskFromColor(sfImage* image, sfColor colorKey, sfUint8 alpha)
{