mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Add Surface::savePNG, powered by IMG_SavePNG.
This commit is contained in:
parent
01735059fc
commit
7570bee178
|
@ -150,6 +150,11 @@ namespace MiniEngine
|
||||||
op.reset(SDL_RWFromMem(mem,size),[](SDL_RWops* p){SDL_RWclose(p);});
|
op.reset(SDL_RWFromMem(mem,size),[](SDL_RWops* p){SDL_RWclose(p);});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Surface::savePNG(const std::string& filename)
|
||||||
|
{
|
||||||
|
return IMG_SavePNG(surf.get(),filename.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
Texture::Texture()
|
Texture::Texture()
|
||||||
{
|
{
|
||||||
updateInfo();
|
updateInfo();
|
||||||
|
|
|
@ -85,7 +85,6 @@ namespace MiniEngine
|
||||||
std::shared_ptr<SDL_RWops> op;
|
std::shared_ptr<SDL_RWops> op;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
enum class BlendMode
|
enum class BlendMode
|
||||||
{
|
{
|
||||||
None = SDL_BLENDMODE_NONE,
|
None = SDL_BLENDMODE_NONE,
|
||||||
|
@ -98,6 +97,7 @@ namespace MiniEngine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~Surface() = default;
|
~Surface() = default;
|
||||||
|
int savePNG(const std::string& filename);
|
||||||
protected:
|
protected:
|
||||||
Surface() = default;
|
Surface() = default;
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user